Align ToolbarIconColor luminance computation with UWP guideline as well to make it consistent with the rest of the browser.

This commit is contained in:
wolfbeast 2017-07-22 01:59:19 +02:00 committed by Roy Tam
commit 9ee75644b9

View file

@ -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");