Instructions
Colour code converter
How to use
- Enter a colour as #1e90ff, rgb(30,144,255), hsl(210,100%,56%) or a name such as tomato, or pick one.
Supported input
- 3-, 4-, 6- and 8-digit HEX (4 and 8 carry alpha), RGB and RGBA 0–255, HSL and HSLA, and the 148 CSS colour names.
- Contrast uses the WCAG 2 relative luminance formula on the colour without its alpha.
Input example
#1e90ff
Result example
rgb(30, 144, 255) · hsl(209.6, 100%, 55.9%)
Troubleshooting
- Values that are not numbers or are out of range are not calculated; the message says what to fix.
Limitations
- Wide-gamut (P3) colours and inputs such as oklch() or lab() are not read; OKLCH is given as a result only.
How it works
- Converts a colour between HEX, RGB, HSL, HSV and OKLCH and measures its contrast with white and black text.