Convert HEX colors to RGB, HSL, HSV, CMYK — with shades, tints, contrast checker & CSS export.
A HEX color like
#6F42C1
encodes three bytes in base-16. Split into pairs:
6F
= 111 red,
42
= 66 green,
C1
= 193 blue. Each pair converts: multiply the first digit by 16 and add the second (both in decimal). Short hex like
#FC0
expands to
#FFCC00
by doubling each digit.
HSL (Hue, Saturation, Lightness) maps RGB to a perceptual color wheel. Hue is the angle (0°–360°), Saturation is color intensity (0–100%), and Lightness is brightness (0% = black, 50% = pure color, 100% = white). HSL is more intuitive than RGB for designers adjusting color themes.
WCAG 2.1 requires a minimum contrast ratio of 4.5:1 for normal text (AA) and 3:1 for large text (18pt+ or 14pt bold). AAA compliance needs 7:1 for normal and 4.5:1 for large text. Ratios are computed from relative luminance values derived from linearized RGB channels.
CMYK (Cyan, Magenta, Yellow, Key/Black) is a subtractive model used in print. Converting from RGB: normalize each channel to 0–1, find K = 1 − max(R,G,B), then C = (1−R−K)/(1−K) and so on. Note that screen-to-print CMYK conversion is an approximation — professional print work requires ICC color profiles.