wolfadex/elm-ansi/3.0.0

NOTE: the latest version is 3.0.1

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

Bright Colors

Custom Color

rgb :
{ red : Int
, green : Int
, blue : 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
= Black
| Red
| Green
| Yellow
| Blue
| Magenta
| Cyan
| White
| BrightBlack
| BrightRed
| BrightGreen
| BrightYellow
| BrightBlue
| BrightMagenta
| BrightCyan
| BrightWhite
| Custom256 { color : Int }
| CustomTrueColor
{ red : Int
, green : Int
, blue : Int
}
= 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