From 9ee75644b96d8532c54ce81dbe17265cfafb66fa Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sat, 22 Jul 2017 01:59:19 +0200 Subject: [PATCH] Align ToolbarIconColor luminance computation with UWP guideline as well to make it consistent with the rest of the browser. --- browser/base/content/browser.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index bbfef0049b..a8aff1bd7b 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -8144,12 +8144,12 @@ var ToolbarIconColor = { let luminances = new Map; for (let toolbar of document.querySelectorAll(toolbarSelector)) { let [r, g, b] = parseRGB(getComputedStyle(toolbar).color); - let luminance = 0.2125 * r + 0.7154 * g + 0.0721 * b; + let luminance = (2 * r + 5 * g + b) / 8; luminances.set(toolbar, luminance); } for (let [toolbar, luminance] of luminances) { - if (luminance <= 110) + if (luminance <= 128) toolbar.removeAttribute("brighttext"); else toolbar.setAttribute("brighttext", "true");