What this color converter does
Designers hand over colours in HEX, CSS frameworks use RGB or HSL, and modern design systems increasingly specify OKLCH for perceptually even palettes. This converter accepts any of these formats, shows the colour in all of them, and generates a row of tints and shades so you can build hover states and backgrounds from a single brand colour.
How to use it
- Type a colour as
#6366f1,#63f,rgb(99, 102, 241)orhsl(239, 84%, 67%), or pick one with the colour picker. - Read the HEX, RGB, HSL and OKLCH equivalents and copy the one your codebase uses.
- Click any swatch in Tints & shades to make it the active colour.
Practical examples
- Design tokens: convert a brand HEX into OKLCH, then adjust only the lightness value to produce a consistent 50–950 scale.
- Hover states: pick the shade one step darker than your button colour for
:hover. - Accessibility: a background from the light tints with dark text usually meets WCAG contrast requirements; check with a contrast checker before shipping.
- Legacy CSS: turn an
hsl()value from a design tool into HEX for an email template where modern syntax is not supported.
Tips and edge cases
- Three-digit HEX is shorthand:
#63fequals#6633ff. - HSL lightness is not perceptual; yellow at 50% looks much brighter than blue at 50%. OKLCH fixes this, which is why it is preferred for generated palettes.
- Alpha values in
rgba()are accepted but ignored in the output; append them manually if you need transparency. - Values outside the sRGB gamut cannot be represented in HEX and are clamped.
- The text colour on the preview switches between black and white based on luminance for readability.