Change "darkwindowframe" calculation on Win 8 to UWP formula.

#31 point 6
This commit is contained in:
wolfbeast
2017-07-19 21:31:28 +02:00
committed by Roy Tam
parent 8aa201ff06
commit 691c200017
+4 -2
View File
@@ -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");
}
}