Skip to main content

Module colors

Module colors 

Source
Expand description

Color utilities for VT Code

This module provides color manipulation capabilities using anstyle, which offers low-level ANSI styling with RGB and 256-color support.

Structs§

StyledString

Functions§

black
Apply black color to text
blend_colors
Blend two RGB colors
blink
Apply blinking styling to text
blue
Apply blue color to text
bold
Apply bold styling to text
color_from_hex
Create an RGB color from hex string
color_to_rgb
Convert an ANSI color to RGB, if possible
contrasting_color
Get a contrasting color (black or white) for better readability
custom_style
Combine multiple color and style operations
cyan
Apply cyan color to text
desaturate_color
Create a desaturated version of a color
dimmed
Apply dimmed styling to text
green
Apply green color to text
is_light_color
Determine if a color is light (for contrast calculations)
italic
Apply italic styling to text
purple
Apply purple color to text
red
Apply red color to text
reversed
Apply reversed styling to text
rgb
Apply custom RGB color to text
strikethrough
Apply strikethrough styling to text
style
Style wrapper for console::style compatibility
underline
Apply underline styling to text
white
Apply white color to text
yellow
Apply yellow color to text