feat: add low transparency mode
This commit is contained in:
parent
32c82f6479
commit
45f97d8f94
4 changed files with 12 additions and 4 deletions
7
app.tsx
7
app.tsx
|
|
@ -22,8 +22,11 @@ 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" || !isLayer(name)) return hex;
|
||||
const amount = style.transparency.get() === "high" ? 0.58 : 0.78;
|
||||
const mode = style.transparency.get();
|
||||
if (mode === "off" || !isLayer(name)) return hex;
|
||||
let amount = 0.78;
|
||||
if (mode === "low") amount = 0.88;
|
||||
else if (mode === "high") amount = 0.58;
|
||||
return `color.change(${hex}, $alpha: ${amount})`;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { Astal } from "astal/gtk3";
|
|||
|
||||
export default {
|
||||
style: {
|
||||
transparency: "normal", // One of "off", "normal", "high"
|
||||
transparency: "normal", // One of "off", "low", "normal", "high"
|
||||
borders: true,
|
||||
vibrant: false, // Extra saturation
|
||||
},
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ const ARR = (type: string | string[]) => `array of ${typeof type === "string" ?
|
|||
const OBJ_ARR = (shape: object) => ARR(JSON.stringify(shape));
|
||||
|
||||
export default {
|
||||
"style.transparency": ["off", "normal", "high"],
|
||||
"style.transparency": ["off", "low", "normal", "high"],
|
||||
"style.borders": BOOL,
|
||||
"style.vibrant": BOOL,
|
||||
"config.notifyOnError": BOOL,
|
||||
|
|
|
|||
|
|
@ -31,6 +31,11 @@ const transparencyActions = {
|
|||
name: "Off",
|
||||
description: "Completely opaque",
|
||||
},
|
||||
low: {
|
||||
icon: "blur_circular",
|
||||
name: "Low",
|
||||
description: "Less transparent",
|
||||
},
|
||||
normal: {
|
||||
icon: "blur_linear",
|
||||
name: "Normal",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue