Commit Graph

4 Commits

Author SHA1 Message Date
Mike de Boer
5dedb6076d Bug 1541829 - Fixup the relative luminance implementation in the Color class and update its consumers with the correct API. r=jaws
Since we rarely touch this code, I took the liberty of changing this to a JS class
and fix the contrast ratio calculations to actually conform to the WCAG spec,
instead of using arbitrary constants.
I changed the `isBright` getter to `useBrightText`, because that is more apt;
we're usually looking for an answer to 'should I use white text on this background?',
instead of looking for an arbitrary threshold to classify a color as being bright.
I updated the tests to cover more of this and clarified the assertion messages as
well.

Differential Revision: https://phabricator.services.mozilla.com/D26097

--HG--
extra : moz-landing-system : lando
2019-04-04 16:36:17 +00:00
Mark Banner
691543ee89 Bug 1486739 - Add missing dangling commas in browser/, services/, taskcluster/ and toolkit/. r=mossop
Automatic changes by ESLint, except for manual corrections for .xml files.

Differential Revision: https://phabricator.services.mozilla.com/D4439

--HG--
extra : moz-landing-system : lando
2018-08-31 05:59:17 +00:00
Florian Quèze
682b1ec3b2 Bug 1440284 - change this.EXPORTED_SYMBOLS back to var EXPORTED_SYMBOLS in JS modules, r=mccr8. 2018-02-23 20:50:01 +01:00
Mike de Boer
a38f90a1a3 Bug 1279717 - introduce a Color.jsm module that implements common color math operations in a single place. r=jaws
MozReview-Commit-ID: Huu58xtApyf
2016-06-22 19:22:05 +02:00