How one colour drives three fields
The native colour input ships on #6366f1, and every movement of that picker fires updateFromPicker. The function slices the hex into three two-digit pairs, parses each as base 16, and prints rgb(99, 102, 241) in the read-only RGB box. HSL follows: channels are divided by 255, lightness is the mean of the maximum and minimum, and hue and saturation use the standard max-minus-min formulas, all rounded to whole numbers, so the colour reads hsl(239, 84%, 67%).
A worked example
Leave the default in place and Palette shows twelve tiles at 30-degree hue steps. The first, at angle zero, rebuilds from the rounded HSL triple and lands on #6467f2, one unit off; angle 90 gives #f264ad and angle 180 gives #f2ef64. The Shades row pins hue 239 and saturation 84 while lightness walks from 10 to 90, printing #04052f at the dark end and #d0d1fb at the light end.
Editing the hex box directly
The HEX field is the only editable output. updateFromHex trims it and tests the string against a six-digit hash pattern; a passing value goes back into the picker and the chain re-runs. Anything else, shorthand like #abc or a stray space, is ignored silently and the other boxes keep the last valid colour. Copy buttons write to the clipboard and flip to Copied! for 1.5 seconds, while a click on any tile copies that tile's hex. The color shade generator lays ramps out as a table, and a color contrast checker scores any pair you sample here.
Where it stops
- Only the six-digit hex form passes validation, so a shorthand like
#abcchanges nothing. - Tiles are regenerated from rounded HSL, so one channel can differ by a unit.
- There is no alpha channel and no CMYK readout; RGB and HSL stay integers.
- Clipboard writes fail quietly outside a secure origin.
- Nothing persists, so a reload returns the shipped indigo.
Questions people ask
Why does the first palette tile differ from my colour?
Hue, saturation and lightness round to whole numbers before the tile converts back, so #6366f1 rebuilds as #6467f2.
Can I type a colour name such as teal?
No. The box expects digits and the letters a to f; names never match the pattern.
How many shades does the row hold?
Ten, at lightness steps of about nine points between 10 and 90.