This page does that: http://leaverou.github.io/contrast-ratio/
Here’s their Javascript that does the job: http://leaverou.github.io/contrast-ratio/contrast-ratio.js > On Oct 6, 2016, at 10:58 AM, Sannyasin Brahmanathaswami <bra...@hindu.org> > wrote: > > For the RGB wizards… what is the algorithm to determine the luminance ratio > between two colors? > > See w3C recommendations posted in today's Adobe's XD newsletter (useful feed) > below. > > I'm thinking the total value of all three will serve. > > > The WC3 sets minimum standards for contrast ratios, which represent how > different a color is from another color (commonly written as 1:1 or 21:1, the > higher the difference between the two numbers in the ratio, the greater the > difference in relative luminance between the colors). The W3C recommends the > following contrast ratios for body text and image text: > > * Small text should have a contrast ratio of at least 4.5:1 against its > background. A ratio of 7:1 is preferred. > * Large text (at 14 pt bold/18 pt regular and up) should have a contrast > ratio of at least 3:1 against its background. > > > > > > > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode