Skip to main content

Module hue_strip

Module hue_strip 

Source
Expand description

HueStrip — 1D hue slider rendered from a CPU-generated 256×1 rainbow texture.

The SDF gradient pipeline caps each Paint::LinearGradient at four stops. A perceptually smooth full-spectrum hue strip needs at least seven (red → yellow → green → cyan → blue → magenta → red), so we generate a 256×1 RGBA texture once via Canvas::ensure_image_registered (idempotent — keyed by name) and draw it via draw_image. The texture costs ~1 KB and is shared across every ColorPicker / ColorEdit instance in the process.

Accessibility is Role::Slider with numeric_value=hue, range 0..360, step 1°, jump 15° (PageUp/Down).