HEX ↔ RGB ↔ HSL ↔ OKLCH ↔ Swift UIColor
Paste or type a color in one supported format and instantly get all conversions, with a live preview and a WCAG contrast check.
Input
WCAG contrast
The converted color is used as text on the background color you choose here.
Result
HEX
#4F46E5
RGB
rgb(79, 70, 229)
HSL
hsl(243, 75%, 59%)
OKLCH
oklch(51.06% 0.23005 276.97)
OKLab
oklab(51.06% 0.0279 -0.22836)
Swift UIColor
UIColor(red: 0.31, green: 0.275, blue: 0.898, alpha: 1)
Contrast ratio
6.28:1
- AA · Normal text Pass (4.5:1)
- AA · Large text Pass (3:1)
- AAA · Normal text Fail (7:1)
- AAA · Large text Pass (4.5:1)
Sample heading
Sample text: this is how a paragraph looks with these two colors.
Large text: At least 24px, or 18.66px bold.