package ocolor

  1. Overview
  2. Docs
Print with style in your terminal using Format's semantic tags

Install

Dune Dependency

Authors

Maintainers

Sources

1.3.0.tar.gz
md5=69d812bbe75df142ad093680ce5a1452
sha512=4d51bf2f5037f67ce262c97896bc8babd9b2beeeb00c492fdaa337b07ed61aa46b9dd1d3feba95a4940f9c0030dd712e8baecbcf94be6d81fdb3d752622d12fc

doc/ocolor/Ocolor_sgr/index.html

Module Ocolor_sgrSource

Sourcetype seq = int list

Until the last moment, it is more convenient to work with list of integers. It is easier to apply several styles at once, since a sequence can be the concatenation of several simple sequences. And, at the last moment, we translate it as the string sequence as it will be passed to the terminal.

Sourceval sgr_of_seq : seq -> string

Translate a list of integer to the corresponding escape sequence string. This is the list of integer separated by Ocolor_config.separator (by default ";"), surrounded by the appropriate prefix and suffix (resp. "\x1b[" and "m")

Sourceval code_of_color3 : Ocolor_types.color4 -> int
Sourceval fg_code_of_color4 : Ocolor_types.color4 -> int
Sourceval code_of_color8 : Ocolor_types.color8 -> int
Sourceval bg_code_of_color4 : Ocolor_types.color4 -> int

Parametric style sequences

Foreground color

Integer sequences
Sourceval default_fg_seq : seq
Sourceval fg_rgb_seq : int -> int -> int -> seq

Legal values for parameters are [0; 255].

Sourceval fg_color4_seq : Ocolor_types.color4 -> seq
Sourceval fg_color8_seq : Ocolor_types.color8 -> seq
Sourceval fg_color24_seq : Ocolor_types.color24 -> seq
Sourceval fg_color_seq : Ocolor_types.color -> seq
Escape sequences
Sourceval default_fg_sgr : string
Sourceval fg_rgb_sgr : int -> int -> int -> string

Legal values for parameters are [0; 255].

Sourceval fg_color4_sgr : Ocolor_types.color4 -> string
Sourceval fg_color8_sgr : Ocolor_types.color8 -> string
Sourceval fg_color24_sgr : Ocolor_types.color24 -> string

Background color

Integer sequences
Sourceval default_bg_seq : seq
Sourceval bg_rgb_seq : int -> int -> int -> seq

Legal values for parameters are [0; 255].

Sourceval bg_color4_seq : Ocolor_types.color4 -> seq
Sourceval bg_color8_seq : Ocolor_types.color8 -> seq
Sourceval bg_color24_seq : Ocolor_types.color24 -> seq
Escape sequences
Sourceval default_bg_sgr : string
Sourceval bg_rgb_sgr : int -> int -> int -> string

Legal values for parameters are [0; 255].

Sourceval bg_color4_sgr : Ocolor_types.color4 -> string
Sourceval bg_color8_sgr : Ocolor_types.color8 -> string
Sourceval bg_color24_sgr : Ocolor_types.color24 -> string
Sourceval bg_color_seq : Ocolor_types.color -> seq

Font

Integer sequences
Sourceval font_seq : int -> seq

Legal values for parameter are [1; 9]

Sourceval default_font_seq : seq
Escape sequences
Sourceval font_sgr : int -> string

Legal values for parameters are [1; 9]

Sourceval default_font_sgr : string

Non parametric style sequences

SGR sequences of common styles as int list

Sourceval reset_seq : seq
Sourceval bold_seq : seq
Sourceval faint_seq : seq
Sourceval italic_seq : seq
Sourceval underlined_seq : seq
Sourceval reverse_video_seq : seq
Sourceval conceal_seq : seq
Sourceval crossed_out_seq : seq
Sourceval fraktur_seq : seq
Sourceval double_underlined_seq : seq
Sourceval faint_bold_off_seq : seq
Sourceval italic_fraktur_off_seq : seq
Sourceval underlined_off_seq : seq
Sourceval reverse_video_off_seq : seq
Sourceval concel_off_seq : seq
Sourceval crossed_out_off_seq : seq
Sourceval framed_seq : seq
Sourceval encircled_seq : seq
Sourceval overlined_seq : seq
Sourceval framed_encircled_off_seq : seq
Sourceval overlined_off_seq : seq

String SGR sequences of common styles

Sourceval reset_sgr : string
Sourceval bold_sgr : string
Sourceval double_underlined_sgr : string
Sourceval faint_sgr : string
Sourceval faint_bold_off_sgr : string
Sourceval italic_sgr : string
Sourceval italic_fraktur_off_sgr : string
Sourceval fraktur_sgr : string
Sourceval underlined_sgr : string
Sourceval underlined_off_sgr : string
Sourceval reverse_video_sgr : string
Sourceval reverse_video_off_sgr : string
Sourceval conceal_sgr : string
Sourceval concel_off_sgr : string
Sourceval crossed_out_sgr : string
Sourceval crossed_out_off_sgr : string
Sourceval framed_sgr : string
Sourceval framed_encircled_off_sgr : string
Sourceval encircled_sgr : string
Sourceval overlined_sgr : string
Sourceval overlined_off_sgr : string

Integer and escape sequence for arbitrary style

Sourceval seq_of_style : Ocolor_types.style -> seq
Sourceval sgr_of_style : Ocolor_types.style -> string
Sourceval seq_of_styles : Ocolor_types.style list -> seq
Sourceval styles_sgr : Ocolor_types.style list -> string
OCaml

Innovation. Community. Security.