diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2017-07-19 21:31:28 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-02-04 20:42:25 +0100 |
commit | 998542d94d86d2bf1f0ac247fcf478c31dcdafec (patch) | |
tree | db576fcd01ce087f8fff6b0c300b1b9aa548a9d5 | |
parent | 0f285318cdf3336aabda0cfa6bc306b2274f14e8 (diff) | |
download | UXP-998542d94d86d2bf1f0ac247fcf478c31dcdafec.tar UXP-998542d94d86d2bf1f0ac247fcf478c31dcdafec.tar.gz UXP-998542d94d86d2bf1f0ac247fcf478c31dcdafec.tar.lz UXP-998542d94d86d2bf1f0ac247fcf478c31dcdafec.tar.xz UXP-998542d94d86d2bf1f0ac247fcf478c31dcdafec.zip |
Change "darkwindowframe" calculation on Win 8 to UWP formula.
#31 point 6
-rwxr-xr-x | browser/base/content/browser.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 7b05e1da7..7aaaa09aa 100755 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -1055,8 +1055,10 @@ var gBrowserInit = { window.matchMedia("(-moz-windows-default-theme)").matches) { let windowFrameColor = new Color(...Cu.import("resource:///modules/Windows8WindowFrameColor.jsm", {}) .Windows8WindowFrameColor.get()); - // Default to black for foreground text. - if (!windowFrameColor.isContrastRatioAcceptable(new Color(0, 0, 0))) { + // Check if window frame color is dark. + if ((windowFrameColor.r * 2 + + windowFrameColor.g * 5 + + windowFrameColor.b) <= 128 * 8) { document.documentElement.setAttribute("darkwindowframe", "true"); } } |