From efec9aa69efd9ba9cbafd93db86962d955574358 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 3 Feb 2022 07:12:15 -0500 Subject: [PATCH] Fix color of cnamed entries in overview pane Additionally, remove pointless (hsluv -> rgb -> hsluv) conversion when computing accent color-based stylsheet. --- src/css/themes/default.css | 4 ++-- src/js/udom.js | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/css/themes/default.css b/src/css/themes/default.css index dd17a7937..d88a46992 100644 --- a/src/css/themes/default.css +++ b/src/css/themes/default.css @@ -222,7 +222,7 @@ --accent-surface-1: rgb(var(--primary-40)); /* popup panel */ - --popup-cell-cname-ink: rgb(var(--blue-50)); + --popup-cell-cname-ink: #0054d7; /* h260 S:100 Luv:40 */; --popup-cell-label-mixed-surface: #c29100; /* TODO: fix */ --popup-icon-x-ink: rgb(var(--red-60)); --popup-power-ink-rgb: var(--primary-50); @@ -299,7 +299,7 @@ --accent-surface-1: rgb(var(--primary-70)); /* popup panel */ - --popup-cell-cname-ink: hsla(0, 0%, 53%, 0.3); + --popup-cell-cname-ink: #93a6ff; /* h260 S:100 Luv:70 */; --popup-cell-label-mixed-surface: hsla(45, 100%, 38%, 1); /* TODO: fix */ --popup-icon-x-ink: rgb(var(--red-50)); --popup-power-ink-rgb: var(--primary-60); diff --git a/src/js/udom.js b/src/js/udom.js index b1acf6058..b9187ea7d 100644 --- a/src/js/udom.js +++ b/src/js/udom.js @@ -104,19 +104,13 @@ DOMListFactory.setAccentColor = function(accentEnabled, accentColor, stylesheet const hsl = self.hsluv.hexToHsluv(accentColor); hsl[0] = Math.round(hsl[0] * 10) / 10; hsl[1] = Math.round(Math.min(100, Math.max(0, hsl[1]))); - hsl[2] = 70; - const rgb = self.hsluv.hsluvToRgb(hsl).map( - a => Math.round(a * 255).toString(16).padStart(2, '0') - ); // Use normalized result to derive all shades - const rgbNormal = `#${rgb.join('')}`; const shades = [ 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 95 ]; const text = []; - const hslNormal = self.hsluv.hexToHsluv(rgbNormal); text.push(':root.accented {'); for ( const shade of shades ) { - hslNormal[2] = shade; - const rgb = self.hsluv.hsluvToRgb(hslNormal).map(a => Math.round(a * 255)); + hsl[2] = shade; + const rgb = self.hsluv.hsluvToRgb(hsl).map(a => Math.round(a * 255)); text.push(` --primary-${shade}: ${rgb.join(' ')};`); } text.push('}', '');