View Source ColorPalette (ColorPalette v0.1.6)
Color Palette Functions
colors/0
: A map between the color name (e.g.,:black
) and theColorPalette.Color
struct.ansi_color_codes/0
- A list of all 256 ANSI color codescolor_groups_to_ansi_color_codes/0
- A map between the color group and the ANSI color codesio_ansi_color_names/0
- TheIO.ANSI
colors and their corresponding text contrast colors.reset/0
- Delegates to theIO.ANSI.reset/0
function.ansi_color_codes_to_color_names/0
- A mapping betweenColorPalette.ANSIColorCode
and color namesfind_by_hex/1
- Finds the colors with a certain hex value, e.g., "aabb00"find_by_code/1
- Finds the colors with a certain ANSI color code (e.g., 0..255).find_by_source/1
- Finds the colors that were obtained fromsource
, wheresource
is one ofColorPalette.source()
color_names/0
- Returns the list of all color names (e.g.,[:aero_blue, :alien_armpit, :alto, ...]
)random_color_name/0
- Returns a random color nameprint_using_random_color/2
- Prints a message in a random color
Colors
See below for the color descriptions. IMPORTANT Note that there are background versions for
each color; e.g., the function tea_green_background/0
(which is not listed below) is the
background color for
Summary
Functions
A mapping between the ANSI color codes (e.g, ColorPalette.ANSIColorCode
) and color
names (e.g., ColorPalette.Color.name()
)
Returns the list of all color names
The main colors data structure. A map between the color name and the ColorPalette.Color
struct
Finds the colors with a certain ANSI color code
Finds the colors with a certain hex value, e.g., "aabb00"
Finds the colors that were obtained from source
, where source
is one of ColorPalette.source()
Prints a message in a random color
Returns a random color name
See IO.ANSI.reset/0
.
Functions
@spec ansi_color_codes() :: [ColorPalette.ANSIColorCode.t()]
@spec ansi_color_codes_missing_names() :: [ColorPalette.ANSIColorCode.code()]
@spec ansi_color_codes_to_color_names() :: %{ required(ColorPalette.ANSIColorCode.t()) => [ColorPalette.Color.t()] }
A mapping between the ANSI color codes (e.g, ColorPalette.ANSIColorCode
) and color
names (e.g., ColorPalette.Color.name()
)
@spec color_data_api_colors() :: [[ColorPalette.Color.t()]]
@spec color_groups_to_ansi_color_codes() :: %{ required(ColorPalette.ColorGroup.t()) => [ColorPalette.ANSIColorCode.t()] }
@spec color_name_dot_com_colors() :: [[ColorPalette.Color.t()]]
@spec color_names() :: [ColorPalette.Color.name()]
Returns the list of all color names
@spec colorhexa_colors() :: [[ColorPalette.Color.t()]]
@spec colors() :: %{required(ColorPalette.Color.name()) => ColorPalette.Color.t()}
The main colors data structure. A map between the color name and the ColorPalette.Color
struct
@spec colors_by_name() :: %{ required(ColorPalette.Color.name()) => ColorPalette.Color.t() }
@spec combined_colors() :: [ColorPalette.Color.t()]
@spec combined_colors_collated() :: %{ required(ColorPalette.Color.name()) => [ColorPalette.Color.t()] }
@spec find_by_code(ColorPalette.ANSIColorCode.code()) :: [ColorPalette.Color.t()]
Finds the colors with a certain ANSI color code
@spec find_by_hex(ColorPalette.ANSIColorCode.hex()) :: [ColorPalette.Color.t()]
Finds the colors with a certain hex value, e.g., "aabb00"
@spec find_by_source(ColorPalette.Color.source()) :: [ColorPalette.Color.t()]
Finds the colors that were obtained from source
, where source
is one of ColorPalette.source()
@spec generated_names_for_unnamed_colors() :: %{ required(ColorPalette.Color.name()) => ColorPalette.Color.t() }
@spec hex_to_color_names() :: %{ required(ColorPalette.ANSIColorCode.hex()) => [ColorPalette.Color.name()] }
@spec io_ansi_color_names() :: [map()]
@spec io_ansi_colors() :: [[ColorPalette.Color.t()]]
@spec print_using_random_color(String.t(), Keyword.t()) :: ColorPalette.Color.name()
Prints a message in a random color
@spec random_color_name() :: ColorPalette.Color.name()
Returns a random color name
@spec raw_color_data_api_data() :: [map()]
@spec raw_color_name_dot_com_data() :: [map()]
@spec raw_colorhexa_data() :: [map()]
See IO.ANSI.reset/0
.