Terminal color handling.
Supports:
Terminal color handling. Supports: - ANSI 16 basic colors (0-15) - ANSI 256 extended palette (0-255) - True color RGB (24-bit)
Current color profile. Default is true-color.
Current color profile. Default is true-color.
(ansi color)Create an ANSI 16 color (0-15). Accepts a number or keyword like :red, :bright-blue.
Create an ANSI 16 color (0-15). Accepts a number or keyword like :red, :bright-blue.
ANSI 16 basic color names to codes.
ANSI 16 basic color names to codes.
ANSI 16 colors as hex values for conversion.
ANSI 16 colors as hex values for conversion.
(ansi256 code)Create an ANSI 256 color (0-255).
Create an ANSI 256 color (0-255).
(apply-color-bg style color)Apply background color to an AttributedStyle.
Apply background color to an AttributedStyle.
(apply-color-fg style color)Apply foreground color to an AttributedStyle.
Apply foreground color to an AttributedStyle.
(detect-color-profile)Detect terminal color profile from environment. Returns :ascii, :ansi, :ansi256, or :true-color.
Detect terminal color profile from environment. Returns :ascii, :ansi, :ansi256, or :true-color.
(downgrade-color color profile)Downgrade a color to fit a color profile.
Downgrade a color to fit a color profile.
(hex hex-str)Create a true color from a hex string like "#ff0000" or "ff0000".
Create a true color from a hex string like "#ff0000" or "ff0000".
(no-color)Create a no-color (transparent) value.
Create a no-color (transparent) value.
(rgb r g b)Create a true color from RGB values (0-255 each).
Create a true color from RGB values (0-255 each).
(rgb->ansi256 {:keys [r g b]})Convert RGB to closest ANSI 256 color.
Convert RGB to closest ANSI 256 color.
(styled-str text & {:keys [fg bg]})Create a styled string with foreground and/or background color. Returns the string with ANSI escape sequences applied.
Create a styled string with foreground and/or background color. Returns the string with ANSI escape sequences applied.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |