Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
val none : t
none
is the empty styling.
val create :
?foreground:[< Color.t ] ->
?background:[< Color.t ] ->
?bold:bool ->
?dim:bool ->
?italic:bool ->
?underlined:bool ->
unit ->
t
create ?foreground ?background ?bold ?dim ?italic ?underlined ()
creates a new style object given the provided configuration.
fg color
is a convenient constructor for creating composable styles. Creates a style with the specified foreground color only. See &
for usage examples.
fg color
is a convenient constructor for creating composable styles. Creates a style with the specified background color only. See &
for usage examples.
val bold : t
bold
is a convenient constructor for creating composable styles. Creates a bold style only. See &
for usage examples.
val dim : t
dim
is a convenient constructor for creating composable styles. Creates a dim style only. See &
for usage examples.
val italic : t
italic
is a convenient constructor for creating composable styles. Creates an italic style only. See &
for usage examples.
val underlined : t
underlined
is a convenient constructor for creating composable styles. Creates an underline style only. See &
for usage examples.
left & right
combines two styles with the following rules:
right
is taken if it's present, otherwise left
Usage example:
let my_style = Styling.(default_style & fg yellow & bg black & bold) in
val to_ansi : t -> string
to_ansi styling
renders the styling
to an ANSI escape sequence as a string.
val wrap : contents:string -> t -> string
wrap ~contents styling
wraps contents
in an ANSI escape sequence using styling
.