wolfadex / elm-ansi / Ansi.Color

For coloring either the font or the background.

Shorthand

fontColor : Color -> String -> String

Sets the color of the text

backgroundColor : Color -> String -> String

Sets the color behind the text

invert : String -> String

Swaps the font and background colors

Basic Colors

black : Color

blue : Color

cyan : Color

green : Color

magenta : Color

red : Color

white : Color

yellow : Color

Bright Colors

brightBlack : Color

brightRed : Color

brightGreen : Color

brightYellow : Color

brightBlue : Color

brightMagenta : Color

brightCyan : Color

brightWhite : Color

Custom Color

rgb : { red : Basics.Int, green : Basics.Int, blue : Basics.Int } -> Color

Specify the amount of red, green, and blue in the range of 0 - 255

Converting from/to HTML colors

fromHtmlColor : Color -> Color

Convert from avh4/elm-color to an ANSI color

toHtmlColor : Color -> Color

Convert from an ANSI color to avh4/elm-color

Explicit


type Color


type Location
    = Font
    | Background

Whether the color is applied to the Font (foreground) or the Background

start : Location -> Color -> String

Set the color for the following text or background

end : Location -> String

Reset to the terminal's default color

startInvert : String

Flip the font and background colors

endInvert : String

Unflip the font and background colors