TinyScarletUnicorn / misc-cogs

MIT License
0 stars 1 forks source link

wcag color cog #53

Open RheingoldRiver opened 8 months ago

RheingoldRiver commented 8 months ago

The WCAG formula/algorithm for determining the contrast between two colors uses the luminance of these colors. That is: sRGB is converted into linear RGB, then the different channels are multiplied with three weights (R 0.2126, G 0.7152, B 0.0722) and then added up to get the luminance.

return the number and 2 swatches, one c1 > c2 and the other c2 > c1, that say Tsubaki

RheingoldRiver commented 8 months ago

https://www.neilbickford.com/blog/2020/10/18/computing-wcag-contrast-ratios/