Design and security
Color converter
Pick a color or type HEX, RGB or HSL. The other fields and the preview follow what you enter.
How to use it
- Click the color sample or type a HEX code. A short form such as #fff works too.
- Copy HEX, RGB or HSL into the style.
- Look at the contrast if text will sit on that color.
The same shade is written differently in a design, in CSS and in a graphics tool. HEX is the usual form in styles, RGB is useful when you need the red, green and blue channels separately, and HSL is useful when you want to lighten a shade or make it stronger without guessing the channels.
Next to the preview, the tool shows the contrast ratio of white and black text on the chosen color. For ordinary text on the web, the aim is at least 4.5 : 1. It is a quick check before you put a shade on a button or a heading, not a replacement for a full accessibility review.
Questions
Does a short HEX work?
Yes. The tool expands #fff to #ffffff and calculates RGB and HSL from that.
What is HSL?
Hue in degrees from 0 to 360, then saturation and lightness as percentages.
Is a good contrast enough?
It is enough for a pair of text and background colors. Letter size and the state of a button are still judged in the design itself.