Ansi_text.Styleinclude module type of Styletype t = Attr.t listModels an ANSI escape sequence that can modify several attributes.
include Ppx_compare_lib.Comparable.S with type t := tinclude Ppx_compare_lib.Comparable.S__local with type t := tinclude Ppx_compare_lib.Equal.S with type t := tinclude Ppx_compare_lib.Equal.S__local with type t := tinclude Ppx_quickcheck_runtime.Quickcheckable.S with type t := tval quickcheck_generator : t Base_quickcheck.Generator.tval quickcheck_observer : t Base_quickcheck.Observer.tval quickcheck_shrinker : t Base_quickcheck.Shrinker.tinclude Sexplib0.Sexpable.S with type t := tinclude Sexplib0.Sexpable.Of_sexp with type t := tval t_of_sexp : Sexplib0.Sexp.t -> tinclude Sexplib0.Sexpable.Sexp_of with type t := tval sexp_of_t : t -> Sexplib0.Sexp.tGives a style that turns off all attributes that are turned on by the given style.
val of_sgr : params:string -> tMake a Style.t from bytes extracted from a parsed string. For example the parser, when handling:
"\027[1;38;5;1m"
would invoke:
of_sgr ~params:"1;38;5;1"
yielding:
[Bold; Fg Red]
val to_string : t -> stringConverts a Style.t to a string. For example
[Bold; Fg Standard Red] -> "\027[1;31m"
Simplifies a Style.t by removing redundant attributes. For example Bold; Bg Blue; Reset; Fg Red; Fg Green -> Reset; Fg Green. This runs in O(n^2) time, but should be ok since Style lists are generally short.
Style that results from applying added_style when old_style is already active.
A minimal style that would transition the active state from old_style to old_style + additional_style.
val to_string_hum : t -> stringLists the attributes in a somewhat human-readable style.
val includes_reset : t -> boolWhether any of the attributes are Reset.
val is_reset : t -> boolWhether final attribute is Reset.