記事一覧Related topics
Colour formats and conversion
How HEX, RGB, HSL, HSV, CMYK, XYZ, LAB, LCH and OKLCH relate to one another, and which to reach for when.
Every colour on a screen is the same physical thing: an amount of red, green and blue light. What changes between formats is how that quantity is written down, and how easy each notation makes a particular job.
That matters more than it sounds. Making a button ten percent darker is one number in HSL and pure guesswork in HEX. Building a colour ramp where every step feels evenly spaced is straightforward in OKLCH and quietly impossible in HSL, because HSL's lightness is geometry rather than perception.
These articles work through the conversions with the arithmetic shown, so you can follow the maths rather than take it on trust.
What you'll learn here
- How to convert HEX to RGB and back by hand, without a tool.
- Why HSL is the right format for hover and active states.
- What CMYK conversion can and cannot tell you about print.
- Why LAB, LCH and OKLCH exist, and where each one earns its keep.












