Catppuccin.Color (catppuccin v0.1.2)

Module for handling color data.

Summary

Types

t()

Data structure representing a color i hex, rgb, and hsl.

Functions

Returns if the color is an accent color.

Returns the base color for the given flavor.

Returns the blue color for the given flavor.

Returns the crust color for the given flavor.

Returns the flamingo color for the given flavor.

Returns the green color for the given flavor.

Returns the lavender color for the given flavor.

Returns the mantle color for the given flavor.

Returns the maroon color for the given flavor.

Returns the mauve color for the given flavor.

Returns the name of the color.

Return the order of the color.

Returns the overlay0 color for the given flavor.

Returns the overlay1 color for the given flavor.

Returns the overlay2 color for the given flavor.

Returns the peach color for the given flavor.

Returns the pink color for the given flavor.

Returns the red color for the given flavor.

Returns the rosewater color for the given flavor.

Returns the sapphire color for the given flavor.

Returns the sky color for the given flavor.

Returns the subtext0 color for the given flavor.

Returns the subtext1 color for the given flavor.

Returns the surface0 color for the given flavor.

Returns the surface1 color for the given flavor.

Returns the surface2 color for the given flavor.

Returns the teal color for the given flavor.

Returns the text color for the given flavor.

Returns the hex code of the color.

Returns the hsl values of the color.

Returns the RGB values of the color.

Returns the yellow color for the given flavor.

Types

t()

@type t() :: %Catppuccin.Color{
  accent: boolean(),
  hex: String.t(),
  hsl: {integer(), integer(), integer()},
  name: String.t(),
  order: integer(),
  rgb: {integer(), integer(), integer()}
}

Data structure representing a color i hex, rgb, and hsl.

Functions

accent(color)

@spec accent(t()) :: boolean()

Returns if the color is an accent color.

Examples

iex> Catppuccin.frappe |> Catppuccin.Color.rosewater |> Catppuccin.Color.accent
true

base(flavor)

Returns the base color for the given flavor.

blue(flavor)

Returns the blue color for the given flavor.

crust(flavor)

Returns the crust color for the given flavor.

flamingo(flavor)

Returns the flamingo color for the given flavor.

green(flavor)

Returns the green color for the given flavor.

lavender(flavor)

Returns the lavender color for the given flavor.

mantle(flavor)

Returns the mantle color for the given flavor.

maroon(flavor)

Returns the maroon color for the given flavor.

mauve(flavor)

Returns the mauve color for the given flavor.

name(color)

@spec name(t()) :: String.t()

Returns the name of the color.

Examples

iex> Catppuccin.frappe |> Catppuccin.Color.rosewater |> Catppuccin.Color.name
"Rosewater"

order(color)

@spec order(t()) :: integer()

Return the order of the color.

Examples

iex> Catppuccin.frappe |> Catppuccin.Color.rosewater |> Catppuccin.Color.order
0

overlay0(flavor)

Returns the overlay0 color for the given flavor.

overlay1(flavor)

Returns the overlay1 color for the given flavor.

overlay2(flavor)

Returns the overlay2 color for the given flavor.

peach(flavor)

Returns the peach color for the given flavor.

pink(flavor)

Returns the pink color for the given flavor.

red(flavor)

Returns the red color for the given flavor.

rosewater(flavor)

Returns the rosewater color for the given flavor.

sapphire(flavor)

Returns the sapphire color for the given flavor.

sky(flavor)

Returns the sky color for the given flavor.

subtext0(flavor)

Returns the subtext0 color for the given flavor.

subtext1(flavor)

Returns the subtext1 color for the given flavor.

surface0(flavor)

Returns the surface0 color for the given flavor.

surface1(flavor)

Returns the surface1 color for the given flavor.

surface2(flavor)

Returns the surface2 color for the given flavor.

teal(flavor)

Returns the teal color for the given flavor.

text(flavor)

Returns the text color for the given flavor.

to_hex(color)

@spec to_hex(t()) :: String.t()

Returns the hex code of the color.

Examples

iex> Catppuccin.frappe |> Catppuccin.Color.rosewater |> Catppuccin.Color.to_hex
"#f2d5cf"

to_hsl(color)

@spec to_hsl(t()) :: {integer(), integer(), integer()}

Returns the hsl values of the color.

Example

iex> Catppuccin.frappe |> Catppuccin.Color.rosewater |> Catppuccin.Color.to_hsl
{10.2857142857143, 0.5737704918032784, 0.8803921568627451}

to_rgb(color)

@spec to_rgb(t()) :: {integer(), integer(), integer()}

Returns the RGB values of the color.

Examples

 iex> Catppuccin.frappe |> Catppuccin.Color.rosewater |> Catppuccin.Color.to_rgb
 {242, 213, 207}

yellow(flavor)

Returns the yellow color for the given flavor.