Library
Module
Module type
Parameter
Class
Class type
A
is for attribute.
Construction and composition of styling characteristics of text.
Consult the basics for an overview.
TL;DR: A.(fg red ++ bg black ++ st bold)
.
One of 256 Xterm-style colors.
Colors outside of the core 16 are widely, but not universally supported.
Note No attempt is made to remap colors depending on the terminal. Colors not recognized by a particular terminal will simply be ignored in the output.
The first 8 have their standard ANSI names.
val black : color
val red : color
val green : color
val yellow : color
val blue : color
val magenta : color
val cyan : color
val white : color
val lightblack : color
val lightred : color
val lightgreen : color
val lightyellow : color
val lightblue : color
val lightmagenta : color
val lightcyan : color
val lightwhite : color
val rgb : r:int -> g:int -> b:int -> color
rgb ~r:red ~g:green ~b:blue
is an extended color from the color cube. All three components must be in the range 0-5
.
val gray : int -> color
gray level
is an extended color from the grayscale ramp. level
must be in the range 0-23
.
val bold : style
val italic : style
val underline : style
val blink : style
val reverse : style
type t = attr
val empty : attr
empty
is the attribute with the default foreground and background color and empty style set.
a1 ++ a2
is the concatenation of a1
and a2
, the attribute that has a2
's foreground (resp. background), unless unset, in which case it is a1
's, and the union of both style sets.
++
and empty
form a monoid. ++
is left-associative.