Module colors

Module colors 

Source
Expand description

Terminal color utilities for visualization Terminal color utilities for visualization output

This module provides utilities for adding colors to terminal output.

Structs§

ColorOptions
Colorization options for terminal output

Enums§

Color
ANSI color codes
Style
ANSI text style

Constants§

RESET
ANSI reset code

Functions§

color_legend
Build a color legend for confusion matrix or other visualizations
colored_metric_cell
Generate table cell content with appropriate color based on value
colored_string
Helper function to conditionally create a string with ANSI coloring for terminal output
colorize
Colorize text with a foreground color
colorize_and_style
Colorize and style text
colorize_bg
Colorize text with a background color
gradient_color
Get the appropriate color based on a value’s position in a range Returns red for values close to 0.0, yellow for values around 0.5, and green for values close to 1.0
heatmap_cell
Generate a heatmap cell with color gradient for confusion matrix
heatmap_color_legend
Build a detailed heatmap color legend
heatmap_gradient_color
Generate a more fine-grained gradient color for heatmap visualizations This provides a more detailed color spectrum for visualizing data with subtle differences Returns a spectrum from cool (blues/purples) for low values to warm (reds/yellows) for high values
stylize
Style text with a text style
supports_color
Detect if the terminal supports colors