How to use the color converter
- Pick a color with the color picker or type a hex value.
- Paste any CSS color, such as
rgb(79 70 229 / 50%),hsl(243 75% 59%)oroklch(51% 0.23 277), and press Convert. - Adjust it with the OKLCH sliders: lightness from black to white, chroma from grey to vivid, and hue around the color wheel.
- Set the opacity if you need a translucent color, and name it for the export.
- Read the formats in the table, and check which text color works on top.
- Export CSS custom properties, SCSS, Tailwind or JSON.
The formats at a glance
- HEX (
#4F46E5) is compact and universal. 8-digit hex adds alpha. - RGB (
rgb(79 70 229)) gives red, green and blue from 0 to 255. - HSL and HWB describe hue with saturation/lightness or whiteness/blackness. They’re easy to read but not perceptually even.
- OKLab and OKLCH are perceptual: equal number changes look like equal visual changes.
Worked examples
Example 1: a lighter hover color
Load Indigo and increase OKLCH lightness by about 8%. The hue and colorfulness stay the same, unlike lightening in HSL, which can turn blues purple.
Example 2: converting a design handoff
A designer sends hsl(160 84% 39%). Paste it, then copy the hex for legacy CSS and the oklch() value for modern code. Both describe the same emerald.
Example 3: a translucent overlay
Load Translucent black (50% opacity). The 8-digit hex #00000080 and rgb(0 0 0 / 0.5) both work as an overlay behind modal dialogs.
Common mistakes
- Judging contrast with alpha. Translucent colors blend with the background, so check contrast on the real page.
- Copying HSL “lightness” between hues. 50% lightness yellow is far brighter than 50% blue; use OKLCH for even steps.
- Rounding too much. Keep at least three decimals for OKLCH chroma.
Tips for working with color formats
Keep one source format in your design files, ideally hex or OKLCH, and convert from it rather than converting conversions. Each trip through rounded RGB values can shift a color slightly. When you share colors with developers, include the format name so nobody mistakes an HSL triplet for RGB.