also dim svg images

This commit is contained in:
Mylloon 2024-12-04 12:02:52 +01:00
parent 2e031e127d
commit 47688337dd
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -54,13 +54,21 @@ const svgChangeTheme = (mode) => {
const treshold = 128;
const style = "filter: ";
const dim = "brightness(0.8) contrast(1.2)";
if (averageGrayscale < treshold && mode === Mode.Dark) {
item.style = "filter: invert(1);";
item.style = style + dim + " invert(1);";
continue;
}
if (averageGrayscale > treshold && mode === Mode.Light) {
item.style = "filter: invert(1);";
item.style = style + "invert(1);";
continue;
}
if (mode === Mode.Dark) {
item.style = style + `${dim};`;
continue;
}