summaryrefslogtreecommitdiffstats
path: root/toolkit/modules
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:54:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:54:08 +0000
commit7443e3d6139ce4f0c822c23d1efb9c097419456d (patch)
tree8e2682b680f95eb05e7f15551464dd1a671b06e2 /toolkit/modules
parentReleasing progress-linux version 125.0.2-1~progress7.99u1. (diff)
downloadfirefox-7443e3d6139ce4f0c822c23d1efb9c097419456d.tar.xz
firefox-7443e3d6139ce4f0c822c23d1efb9c097419456d.zip
Merging upstream version 125.0.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/modules')
-rw-r--r--toolkit/modules/LightweightThemeConsumer.sys.mjs21
1 files changed, 20 insertions, 1 deletions
diff --git a/toolkit/modules/LightweightThemeConsumer.sys.mjs b/toolkit/modules/LightweightThemeConsumer.sys.mjs
index cf388eb3d3..0d3993370b 100644
--- a/toolkit/modules/LightweightThemeConsumer.sys.mjs
+++ b/toolkit/modules/LightweightThemeConsumer.sys.mjs
@@ -183,7 +183,26 @@ const toolkitVariableMap = [
"--newtab-background-color-secondary",
{ lwtProperty: "ntp_card_background" },
],
- ["--newtab-text-primary-color", { lwtProperty: "ntp_text" }],
+ [
+ "--newtab-text-primary-color",
+ {
+ lwtProperty: "ntp_text",
+ processColor(rgbaChannels, element) {
+ if (!rgbaChannels) {
+ element.removeAttribute("lwt-newtab-brighttext");
+ return null;
+ }
+
+ const { r, g, b } = rgbaChannels;
+ element.toggleAttribute(
+ "lwt-newtab-brighttext",
+ 0.2125 * r + 0.7154 * g + 0.0721 * b > 110
+ );
+
+ return _rgbaToString(rgbaChannels);
+ },
+ },
+ ],
];
export function LightweightThemeConsumer(aDocument) {