summaryrefslogtreecommitdiff
path: root/browser
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2017-07-19 21:31:28 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-02-04 20:42:25 +0100
commit998542d94d86d2bf1f0ac247fcf478c31dcdafec (patch)
treedb576fcd01ce087f8fff6b0c300b1b9aa548a9d5 /browser
parent0f285318cdf3336aabda0cfa6bc306b2274f14e8 (diff)
downloaduxp-998542d94d86d2bf1f0ac247fcf478c31dcdafec.tar.gz
Change "darkwindowframe" calculation on Win 8 to UWP formula.
#31 point 6
Diffstat (limited to 'browser')
-rwxr-xr-xbrowser/base/content/browser.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
index 7b05e1da79..7aaaa09aa2 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");
}
}