Module Ansi_text.AttrSource

include module type of Attr
Sourcetype t =
  1. | Reset
  2. | Bold
    (*

    intensity

    *)
  3. | Faint
    (*

    intensity

    *)
  4. | Normal_weight
    (*

    intensity

    *)
  5. | Italic
    (*

    emphasis

    *)
  6. | Fraktur
    (*

    emphasis (rarely supported)

    *)
  7. | Not_emphasis
    (*

    emphasis

    *)
  8. | Underline
    (*

    underline

    *)
  9. | Double_ul
    (*

    underline

    *)
  10. | Not_underline
    (*

    underline

    *)
  11. | Framed
    (*

    framing (rarely supported)

    *)
  12. | Encircled
    (*

    framing (rarely supported)

    *)
  13. | Not_framed
    (*

    framing (also cancels Encircled)

    *)
  14. | Superscript
    (*

    sub/super script (rarely supported)

    *)
  15. | Subscript
    (*

    sub/super script (rarely supported)

    *)
  16. | Not_script
    (*

    sub/super script

    *)
  17. | Invert
    (*

    invert fg/bg colors

    *)
  18. | Not_invert
    (*

    invert fg/bg colors

    *)
  19. | Hide
    (*

    hide text

    *)
  20. | Not_hide
    (*

    hide text

    *)
  21. | Strike
    (*

    strikethrough

    *)
  22. | Not_strike
    (*

    strikethrough

    *)
  23. | Overline
    (*

    overline

    *)
  24. | Not_overline
    (*

    overline

    *)
  25. | Variable_width
    (*

    proportional spacing (rarely supported)

    *)
  26. | Fixed_width
    (*

    proportional spacing

    *)
  27. | Fg of Color.t
  28. | Bg of Color.t
  29. | Ul_color of Color.t
  30. | Font of int
    (*

    0-10; default font is 0 (rarely supported)

    *)
  31. | Ideogram of int
    (*

    0-5; no ideograms is 5 (rarely supported)

    *)
  32. | Other of int list

Grouped into related attributes that override one another, e.g. intensity, emphasis.

include Ppx_compare_lib.Comparable.S with type t := t
Sourceval compare : t -> t -> int
include Ppx_compare_lib.Equal.S with type t := t
Sourceval 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
Sourceval quickcheck_generator : t Base_quickcheck.Generator.t
Sourceval quickcheck_observer : t Base_quickcheck.Observer.t
Sourceval quickcheck_shrinker : t Base_quickcheck.Shrinker.t
include Sexplib0.Sexpable.S with type t := t
include Sexplib0.Sexpable.Of_sexp with type t := t
Sourceval t_of_sexp : Sexplib0.Sexp.t -> t
include Sexplib0.Sexpable.Sexp_of with type t := t
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
Sourceval turn_off : t -> t option

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

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

Whether new_attr overrides the style effects of old_attr. For example, Bold, Faint, and Normal_weight all override one another.

Sourceval 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.

Sourceval to_code : t -> int list

Converts an Attr.t to an ANSI code.

Sourceval to_string : t -> string

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

Sourceval to_string_hum : t -> string

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