The colour spaces
HEX and RGB are the same thing written differently: three channels of 0–255, one each for red, green and blue.#7c3aed is rgb(124, 58, 237).
HSL describes hue (position on the colour wheel), saturation (how vivid) and lightness (how close to white or black). It is far easier to work with when building a palette: keep hue and saturation fixed, vary lightness, and you have a coherent scale — which is what the lightness row above generates.
HSV replaces lightness with value (brightness). It is what most colour pickers use internally, since the square-plus-slider layout maps naturally onto saturation and value.
Contrast is calculated, not eyeballed
The WCAG contrast ratio compares the relative luminance of two colours, from 1:1 (identical) to 21:1 (black on white). The calculation linearises each sRGB channel before weighting it, because sRGB values are gamma-encoded — averaging the raw numbers, a common shortcut, gives ratios wrong by enough to pass text that genuinely fails.
The thresholds: 4.5:1 for normal text at AA, 3:1 for large text (18pt, or 14pt bold), and 7:1 for AAA. These are minimums for legibility, not targets — comfortable extended reading usually wants more.
Two things the ratio does not capture: it treats all hues identically, so it cannot tell you that red on green is a problem for the most common form of colour blindness, and it says nothing about font weight or size beyond the large-text threshold. Thin light text can meet the ratio and still be hard to read.