mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-26 05:38:39 +00:00
Change "darkwindowframe" calculation on Win 8 to UWP formula.
#31 point 6
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user