How it works
HEX is two digits each of red, green, and blue. RGB is those same channels as numbers from 0 to 255. HSL turns the channels into a hue in degrees, plus saturation and lightness as percentages. White is hsl(0, 0%, 100%). Red is hsl(0, 100%, 50%).
The picker and the hex field stay in sync. Editing RGB or HSL and leaving the field writes the matching hex back. A short form such as #fff is rejected so a half-typed value is not guessed. Nothing is uploaded.
Formula
- HEX
#rrggbb - White
#ffffff = rgb(255, 255, 255) = hsl(0, 0%, 100%) - Red
hsl(0, 100%, 50%) = rgb(255, 0, 0)
Worked examples
The site ink
#1c1915 is rgb(28, 25, 21). The swatch uses that hex.
Pure red from HSL
Hue 0, saturation 100%, lightness 50% converts back to rgb(255, 0, 0) and #ff0000.
| Form | Example | Range |
|---|---|---|
| HEX | #1c1915 | 00–ff per channel |
| RGB | 28, 25, 21 | 0–255 per channel |
| HSL | 20, 14%, 10% | Hue 0–360, S and L 0–100% |
Common questions
Is the color uploaded?
No. The conversion runs in your browser.
Why not #fff?
The field accepts 6 digits so it matches the picker, which always writes 6. Expand #fff to #ffffff.
Do RGB and HSL round?
HSL percentages and the hue are rounded to whole numbers for display. Converting back can be off by one channel on some colors. The hex value is the one the swatch uses.
Can I copy just one form?
Yes. Copy HEX, Copy RGB, and Copy HSL each copy that field only.