package ansifmt

  1. Overview
  2. Docs
type t = {
  1. foreground : Color.t option;
  2. background : Color.t option;
  3. bold : bool;
  4. dim : bool;
  5. italic : bool;
  6. underlined : bool;
}
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.

val to_ansi : t -> string

to_ansi styling renders the styling to an ANSI escape sequence as a string.

OCaml

Innovation. Community. Security.