contrastRatio(against:) is the WCAG 2 contrast ratio of two opaque colors. Black on white is 21.
contrastRatio(against:)
21
let gray = Color<SRGB>( red: 118.0 / 255.0, green: 118.0 / 255.0, blue: 118.0 / 255.0 ) let white = Color<SRGB>(red: 1, green: 1, blue: 1) let ratio = gray.contrastRatio(against: white)
#767676 on white is 4.54:1.
#767676
4.54:1
See also Conversions, Interpolation, Difference.
There was an error while loading. Please reload this page.
Colorful
Home Conversions Interpolation Contrast Difference