Module Ansi_text.Attr

include module type of Attr
type t =
  1. | Reset
  2. | Bold
  3. | Faint
  4. | Italic
  5. | Underline
  6. | Double_ul
  7. | Invert
  8. | Hide
  9. | Strike
  10. | Overline
  11. | Not_bold_or_faint
  12. | Not_italic
  13. | Not_underline
  14. | Not_invert
  15. | Not_hide
  16. | Not_strike
  17. | Not_overline
  18. | Fg of Color.t
  19. | Bg of Color.t
  20. | Ul_color of Color.t
  21. | Other of int list
include Ppx_compare_lib.Comparable.S with type t := t
val compare : t -> t -> int
include Ppx_compare_lib.Equal.S with type t := t
val equal : t -> t -> bool
include Ppx_compare_lib.Equal.S__local with type t := t
include Ppx_quickcheck_runtime.Quickcheckable.S with type t := t
val quickcheck_generator : t Base_quickcheck.Generator.t
val quickcheck_observer : t Base_quickcheck.Observer.t
val quickcheck_shrinker : t Base_quickcheck.Shrinker.t
include Sexplib0.Sexpable.S with type t := t
include Sexplib0.Sexpable.Of_sexp with type t := t
val t_of_sexp : Sexplib0.Sexp.t -> t
include Sexplib0.Sexpable.Sexp_of with type t := t
val sexp_of_t : t -> Sexplib0.Sexp.t
val turn_off : t -> t option

Gives an attribute that turns off the given atribute (if applicable).

val overrides : new_attr:t -> old_attr:t -> bool

Whether new_attr overrides the style effects of old_attr.

val of_codes : int list -> t

Creates an Attr.t from a list of SGR parameter codes. Known codes (like 1 for bold or 38;5;196 for 256-color red foreground) are parsed into specific variants. Unrecognized codes are returned as Other codes.

val to_code : t -> int list

Converts an Attr.t to an ANSI code.

val to_string : t -> string

Converts an Attr.t to a string. For example Fg Standard Red -> "31".

val to_string_hum : t -> string

A somewhat human-readable name for what the attribute is changing.