View Source ColorPalette

A library which brings additional named colors via 8 bit ANSI color escape codes into Elixir (in addition to the 16 standard named IO.ANSI colors, such as :red, :blue, :cyan, :light_red, :light_blue, :light_cyan, etc.)

Installation

The package can be installed by adding color_palette to your list of dependencies in mix.exs:

def deps do
  [
    {:color_palette, "~> 0.1"}
  ]
end

Documentation can be found here and a full list of colors here.

Usage

This hex package adds some ~364 additional named colors to use in Elixir terminal scripts, based on the 256 ANSI color code sequences (so some of the color names are duplicates and reference the same color).
Note that some of the colors are approximations, as the color space for the ANSI color codes is rather limited (it's 8 bit). The values were obtained by accessing TheColorAPI and also color-name.com.

Usage is similar to IO.ANSI. So in your Elixir script module, you can either reference ColorPalette color functions directly (e.g., ColorPalette.aero_blue/0) or you can import all of the color functions for easier usage:


def MyModule do
  import ColorPalette

  def fancy_print do
    IO.puts(aero_blue() <> "This line is in aero blue!" <> reset())
    IO.puts(alien_armpit() <> "This line is in alien armpit!" <> reset())
  end
end

MyModule.fancy_print()

So add some

:alien_armpit

to your scripts! Or how about some

:true_blue

or

:macaroni_and_cheese

or

:bright_turquoise

or

:dark_candy_apple_red

or

:laser_lemon

or some

:very_light_malachite_green

See the main module page for ColorPalette to see a list of all of the colors!