Skip to main content

Module hsv_canvas

Module hsv_canvas 

Source
Expand description

HsvCanvas — 2D saturation × value picker rendered as three stacked gradients.

Layer 1: solid fill with the current hue at full saturation + full value. Layer 2: white→transparent linear gradient left→right (saturation axis). Layer 3: transparent→black linear gradient top→bottom (value axis, inverted so the top of the canvas is the bright end). The three layers composite under standard SrcOver blending to form the HSV picker’s familiar square gradient.

The current selection is shown as a double-ring indicator (white outer, dark inner) so it stays visible against any underlying color combination.

§Accessibility

The canvas is fundamentally a 2D pointer gesture with no ARIA precedent. Screen-reader users navigate the picker via the hue / saturation / value sliders or RGB / HSV / hex spinners — the containing ColorPicker excludes this widget’s subtree from the AT tree via .access_exclude_subtree(). This widget itself emits a Role::GenericContainer placeholder so the override has something to prune.