Contrast ratios can range from 1 to 21 (commonly written 1:1 to 21:1). (L1 + 0.05) / (L2 + 0.05), whereby:
•
L1 is the relative luminance of the lighter of the colors, and
•
L2 is the relative luminance of the darker of the colors.
L = 0.2126 * R + 0.7152 * G + 0.0722 * B where R, G and B are de ned as:
• if R <= 0.03928 then R = R /12.92 else R = ((R +0.055)/1.055) ^ 2.4 sRGB
sRGB
sRGB
• if G <= 0.03928 then G = G /12.92 else G = ((G +0.055)/1.055) ^ 2.4 sRGB
sRGB
sRGB
• if B <= 0.03928 then B = B /12.92 else B = ((B +0.055)/1.055) ^ 2.4 sRGB
sRGB
sRGB
and R , G , and B are de ned as: sRGB
sRGB
sRGB
• R = R /255 sRGB
8bit
• G = G /255 sRGB
8bit
• B = B /255 8bit
fi
https://medium.muz.li/the-science-of-color-contrast-an-expert-designers-guide-33e84c41d156 fi
sRGB