One dye, four labels: type the colour of Mr. Harun’s sign in any format, the browser reads it, then it is written as hex, rgb, hsl and oklch with its WCAG…
Why it matters
A format is not just a writing style. hsl is easy to tweak, oklch makes palettes with even lightness, alpha makes overlays without fading the text, and WCAG contrast decides whether your text can be read.
The key idea
Lightness 50% in hsl is not the same lightness to the eye
Common mistakes
Picking a text colour because it "looks fine" on your own screen Screens, brightness and eyes differ. Check the WCAG contrast ratio: at least 4.5:1 for normal text, 3:1 for large text (24px, or 18.66px bold). Grey #9ca3af on white is only 2.5:1.
A palette looks uneven although its lightness steps are equal Even lightness steps in hsl look uneven because every hue has its own lightness to the eye. Build the scale in oklch: the same L, the same lightness.
A see-through overlay fades all its children tooopacity fades the whole element and its children. Alpha in the colour (rgb(0 0 0 / 50%), #00000080) makes only that colour see-through.
Try it in this playground
Write one colour in two formats Click "Use" on the hsl or oklch row. The text differs, the colour the browser reads is exactly the same.
Make white text pass AA on the orange sign Lower the background lightness until the ratio is at least 4.5:1. The hue may stay.
Try opacity: 0.5, then move the transparency into the colour alpha With opacity the lettering fades too. With rgb(0 0 0 / 50%) only the background is see-through.
Write oklch with chroma 0.3 Many oklch colours do not fit sRGB. Hex, rgb and hsl can only write their nearest version.