View Source ExAequoColors (ExAequoColors v0.1.2)

Features

  • ANSI Colors

  • Extended ANSI Color, suffixs

  • colorize CLI

Summary

Functions

ANSI code for a color to a string

We can use the 8 basic ANSI color codes

Convenience delegation

Colorizes and puts to device

Functions

col(subject, flag)

ANSI code for a color to a string

We can use the 8 basic ANSI color codes

iex(1)> col("This is red", :red)
"\e[31mThis is red"

Or we can add a reset

iex(2)> col("This is red", :red, :reset)
"\e[31mThis is red\e[0m"

Which can also be achieved by means of the colr function

iex(3)> colr("This is red", :red)
"\e[31mThis is red\e[0m"

We can also add bold or dim

iex(4)> col("Bold and blue", :bold, :blue)
"\e[1m\e[34mBold and blue"

iex(5)> col("Green and dim", :green, :dim)
"\e[32m\e[2mGreen and dim"

col(subject, flag1, flag2)

colorize(line)

See ExAequoColors.Colorizer.colorize/1.

colorize(line, options)

Convenience delegation

colr(subject, flag)

colr(subject, flag1, flag2)

puts_col(line, device \\ :stdio)

Colorizes and puts to device

version()