Color HEX/RGB Generator & Picker
Colors on the web are represented in multiple formats: HEX (hexadecimal like #FF5733), RGB (red, green, blue values from 0-255), and HSL (hue, saturation, lightness). Each format has its use cases — HEX is compact for CSS, RGB is intuitive for mixing, and HSL is natural for adjusting brightness and saturation.
This tool lets you generate, pick, and convert colors between all three formats in real-time. It also calculates WCAG contrast ratios against white and black backgrounds, helping you ensure your color choices meet accessibility standards (AA and AAA levels).
How it works
HEX to RGB: parse pairs of hex digits as decimal 0-255. RGB to HSL: normalize RGB to 0-1, compute hue from max channel, saturation from chroma/lightness, lightness as (max+min)/2. WCAG contrast ratio: (L1 + 0.05) / (L2 + 0.05) where L is relative luminance.
Use cases
- Converting colors between HEX, RGB, and HSL formats for CSS
- Checking color accessibility against WCAG AA/AAA standards
- Finding complementary, analogous, and triadic color harmonies
- Generating random colors for design inspiration