summaryrefslogtreecommitdiff
path: root/app.tsx
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-03-23 18:22:06 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-03-23 18:22:06 +1100
commit43c34d02db2477c6e847a5d7581b51be1f86e665 (patch)
treea1b9662db064867a68a77858b98235c9acd113d3 /app.tsx
parentwallpapers: fix error on no paths (diff)
downloadcaelestia-shell-43c34d02db2477c6e847a5d7581b51be1f86e665.tar.gz
caelestia-shell-43c34d02db2477c6e847a5d7581b51be1f86e665.tar.bz2
caelestia-shell-43c34d02db2477c6e847a5d7581b51be1f86e665.zip
misc code refactoring
Diffstat (limited to 'app.tsx')
-rw-r--r--app.tsx14
1 files changed, 4 insertions, 10 deletions
diff --git a/app.tsx b/app.tsx
index 820d322..ff7601a 100644
--- a/app.tsx
+++ b/app.tsx
@@ -15,22 +15,16 @@ import { App } from "astal/gtk3";
import { style } from "config";
import { initConfig, updateConfig } from "config/funcs";
-const shouldBeTransparent = (name: string) =>
- name === "base" ||
- name === "mantle" ||
- name === "crust" ||
- name.startsWith("surface") ||
- name.startsWith("overlay");
+const isLayer = (name: string) =>
+ ["base", "mantle", "crust"].includes(name) || name.startsWith("surface") || name.startsWith("overlay");
const applyTransparency = (name: string, hex: string) => {
- if (style.transparency.get() === "off" || !shouldBeTransparent(name)) return hex;
+ if (style.transparency.get() === "off" || !isLayer(name)) return hex;
const amount = style.transparency.get() === "high" ? 0.58 : 0.78;
return `color.change(${hex}, $alpha: ${amount})`;
};
-const applyVibrancy = (hex: string) => {
- return style.vibrant.get() ? `color.scale(${hex}, $saturation: 40%)` : hex;
-};
+const applyVibrancy = (hex: string) => (style.vibrant.get() ? `color.scale(${hex}, $saturation: 40%)` : hex);
export const loadStyleAsync = async () => {
const schemeColours = Object.entries(Palette.get_default().colours)