Module

Choku.Color

Package
purescript-choku
Repository
m15a/purescript-choku

Chalk's color representations.

Chalk supports three color representations: RGB, hex, and ANSI 256 colors. Foreground and background colors can be specified using one of them through fg and bg styling functions, respectively.

See also

#Color Source

data Color

Constructors

Instances

#mkRGB Source

mkRGB :: Int -> Int -> Int -> Maybe Color

Safe constructor to make a Color from RGB values.

Returns Nothing with out-of-bounds inputs.

#mkHex Source

mkHex :: String -> Maybe Color

Safe constructor to make a Color from Hex string.

Returns Nothing with invalid Hex string. Prefix # is not mandatory. Hex digits of either length 6 (e.g., #0a0b0c) or 3 (e.g., #ABC) are accepted.

#mkANSI256 Source

mkANSI256 :: Int -> Maybe Color

Safe constructor to make a Color from ANSI256 integer value between 0 and 255.

Returns Nothing with out-of-bounds input.