Module Ansi_text.Color

include module type of Color
module Sgr8 : sig ... end
module Rgb6 : sig ... end

Models the rgb subset of the codes under "38;5" and "48;5".

module Gray24 : sig ... end

Models the grayscale subset of the codes under "38;5" and "48;5".

module Rgb256 : sig ... end

Models the rgb codes under "38;2" and "48;2".

type t =
  1. | Default
  2. | Standard of Sgr8.t
  3. | Bright of Sgr8.t
  4. | Rgb6 of Rgb6.t
  5. | Gray24 of Gray24.t
  6. | Rgb256 of Rgb256.t

Unifies all the ANSI color types.

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 to_fg_code : t -> int list
val to_bg_code : t -> int list
val to_ul_code : t -> int list
val sgr8_exn : ?bright:bool -> int -> t

Generates a Standard or Bright color based on an integer 0-15.

val rgb6_exn : (int * int * int) -> t

Generates an Rgb6 color based on r, g, and b integers 0-5.

val gray24_exn : int -> t

Generates a Gray24 color based on an integer 232-255.

val rgb256_exn : (int * int * int) -> t

Generates an Rgb256 color based on r, g, and b integers 0-255.

val to_string_hum : t -> string

A somewhat human-readable name for a color.

val black : t
val red : t
val green : t
val yellow : t
val blue : t
val magenta : t
val cyan : t
val white : t
val gray : t
val default_text_color_for : bg:t -> t

Returns white, black or default to be used as the fg color for the given bg. Attempts to use white for dark backgrounds, black for light backgrounds, and default in between.