HEX, RGB and HSL explained
HEX and RGB describe the same thing: amounts of red, green and blue from 0 to 255. HEX writes them as three pairs of hexadecimal digits, so rgb(37, 99, 235) is #2563EB. HSL describes color the way people think about it: hue as an angle on the color wheel, saturation as intensity and lightness from black to white. HSL makes it easy to create lighter or darker variations of a color by changing one number.
Contrast ratios and accessibility
WCAG measures contrast using relative luminance, producing a ratio from 1:1 (no contrast) to 21:1 (black on white). Level AA requires at least 4.5:1 for normal text and 3:1 for large text, which is 24 px regular or about 18.7 px bold. Level AAA requires 7:1 and 4.5:1. Meeting these ratios helps people with low vision and anyone reading a screen in bright sunlight. Contrast is only one part of accessibility; never rely on color alone to convey meaning.