mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-24 16:17:29 +09:00
Change "darkwindowframe" calculation on Win 8 to UWP formula.
#31 point 6
This commit is contained in:
parent
8aa201ff06
commit
691c200017
1 changed files with 4 additions and 2 deletions
|
|
@ -1055,8 +1055,10 @@ var gBrowserInit = {
|
||||||
window.matchMedia("(-moz-windows-default-theme)").matches) {
|
window.matchMedia("(-moz-windows-default-theme)").matches) {
|
||||||
let windowFrameColor = new Color(...Cu.import("resource:///modules/Windows8WindowFrameColor.jsm", {})
|
let windowFrameColor = new Color(...Cu.import("resource:///modules/Windows8WindowFrameColor.jsm", {})
|
||||||
.Windows8WindowFrameColor.get());
|
.Windows8WindowFrameColor.get());
|
||||||
// Default to black for foreground text.
|
// Check if window frame color is dark.
|
||||||
if (!windowFrameColor.isContrastRatioAcceptable(new Color(0, 0, 0))) {
|
if ((windowFrameColor.r * 2 +
|
||||||
|
windowFrameColor.g * 5 +
|
||||||
|
windowFrameColor.b) <= 128 * 8) {
|
||||||
document.documentElement.setAttribute("darkwindowframe", "true");
|
document.documentElement.setAttribute("darkwindowframe", "true");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue