Guide API
Skip to main content

rgb_to_xterm16

Function rgb_to_xterm16 

Source
pub const fn rgb_to_xterm16(r: u8, g: u8, b: u8) -> u8
Expand description

Convert an RGB triplet to the nearest xterm-16 / BIOS-style index (0..=15).

Uses the Hue-Chroma-Lightness colour model for perceptually plausible quantization.