Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

fix: allow all accents to be used #232

Merged
merged 1 commit into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 2 additions & 26 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,38 +231,13 @@ def gnome_shell_version():
f"@import 'extensions-{GS_VERSION}';",
)


# Accent translation
ctp_to_colloid = {
"rosewater": "pink",
"flamingo": "pink",
"pink": "pink",
"mauve": "purple",
"red": "red",
"maroon": "red",
"peach": "orange",
"yellow": "yellow",
"green": "green",
"teal": "teal",
"sky": "teal",
"sapphire": "default",
"blue": "default",
"lavender": "default",
}


def translate_accent(ctp_accent: Color):
return ctp_to_colloid[ctp_accent.identifier]


def write_tweak(key, default, value):
subst_text(
f"{SRC_DIR}/sass/_tweaks-temp.scss", f"\\${key}: {default}", f"${key}: {value}"
)


def apply_tweaks(ctx: BuildContext):
write_tweak("theme", "'default'", f"'{translate_accent(ctx.accent)}'")
write_tweak("theme", "'default'", f"'{ctx.accent.identifier}'")

if ctx.size == "compact":
write_tweak("compact", "'false'", "'true'")
Expand Down Expand Up @@ -476,6 +451,7 @@ def apply_colloid_patches():
for patch in [
"plank-dark.patch",
"plank-light.patch",
"theme-func.patch",
"sass-palette-frappe.patch",
"sass-palette-mocha.patch",
"sass-palette-latte.patch",
Expand Down
17 changes: 16 additions & 1 deletion patches/colloid/palette.tera
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,22 @@ new file mode 100644
index 00000000..4ff0da0d
--- /dev/null
+++ b/src/sass/_color-palette-catppuccin-{{ flavor.identifier }}.scss
@@ -0,0 +1,72 @@
@@ -0,0 +1,87 @@
+ // Our accents
+ $rosewater: #{{ palette.rosewater.hex }};
+ $flamingo: #{{ palette.flamingo.hex }};
+ $pink: #{{ palette.pink.hex }};
+ $mauve: #{{ palette.mauve.hex }};
+ $red: #{{ palette.red.hex }};
+ $maroon: #{{ palette.maroon.hex }};
+ $peach: #{{ palette.peach.hex }};
+ $yellow: #{{ palette.yellow.hex }};
+ $green: #{{ palette.green.hex }};
+ $teal: #{{ palette.teal.hex }};
+ $sky: #{{ palette.sky.hex }};
+ $sapphire: #{{ palette.sapphire.hex }};
+ $blue: #{{ palette.blue.hex }};
+ $lavender: #{{ palette.lavender.hex }};
+// Default Theme Color Palette
+
+// Red
Expand Down
17 changes: 16 additions & 1 deletion patches/colloid/sass-palette-frappe.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,22 @@ new file mode 100644
index 00000000..4ff0da0d
--- /dev/null
+++ b/src/sass/_color-palette-catppuccin-frappe.scss
@@ -0,0 +1,72 @@
@@ -0,0 +1,87 @@
+ // Our accents
+ $rosewater: #f2d5cf;
+ $flamingo: #eebebe;
+ $pink: #f4b8e4;
+ $mauve: #ca9ee6;
+ $red: #e78284;
+ $maroon: #ea999c;
+ $peach: #ef9f76;
+ $yellow: #e5c890;
+ $green: #a6d189;
+ $teal: #81c8be;
+ $sky: #99d1db;
+ $sapphire: #85c1dc;
+ $blue: #8caaee;
+ $lavender: #babbf1;
+// Default Theme Color Palette
+
+// Red
Expand Down
17 changes: 16 additions & 1 deletion patches/colloid/sass-palette-latte.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,22 @@ new file mode 100644
index 00000000..4ff0da0d
--- /dev/null
+++ b/src/sass/_color-palette-catppuccin-latte.scss
@@ -0,0 +1,72 @@
@@ -0,0 +1,87 @@
+ // Our accents
+ $rosewater: #dc8a78;
+ $flamingo: #dd7878;
+ $pink: #ea76cb;
+ $mauve: #8839ef;
+ $red: #d20f39;
+ $maroon: #e64553;
+ $peach: #fe640b;
+ $yellow: #df8e1d;
+ $green: #40a02b;
+ $teal: #179299;
+ $sky: #04a5e5;
+ $sapphire: #209fb5;
+ $blue: #1e66f5;
+ $lavender: #7287fd;
+// Default Theme Color Palette
+
+// Red
Expand Down
17 changes: 16 additions & 1 deletion patches/colloid/sass-palette-macchiato.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,22 @@ new file mode 100644
index 00000000..4ff0da0d
--- /dev/null
+++ b/src/sass/_color-palette-catppuccin-macchiato.scss
@@ -0,0 +1,72 @@
@@ -0,0 +1,87 @@
+ // Our accents
+ $rosewater: #f4dbd6;
+ $flamingo: #f0c6c6;
+ $pink: #f5bde6;
+ $mauve: #c6a0f6;
+ $red: #ed8796;
+ $maroon: #ee99a0;
+ $peach: #f5a97f;
+ $yellow: #eed49f;
+ $green: #a6da95;
+ $teal: #8bd5ca;
+ $sky: #91d7e3;
+ $sapphire: #7dc4e4;
+ $blue: #8aadf4;
+ $lavender: #b7bdf8;
+// Default Theme Color Palette
+
+// Red
Expand Down
17 changes: 16 additions & 1 deletion patches/colloid/sass-palette-mocha.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,22 @@ new file mode 100644
index 00000000..4ff0da0d
--- /dev/null
+++ b/src/sass/_color-palette-catppuccin-mocha.scss
@@ -0,0 +1,72 @@
@@ -0,0 +1,87 @@
+ // Our accents
+ $rosewater: #f5e0dc;
+ $flamingo: #f2cdcd;
+ $pink: #f5c2e7;
+ $mauve: #cba6f7;
+ $red: #f38ba8;
+ $maroon: #eba0ac;
+ $peach: #fab387;
+ $yellow: #f9e2af;
+ $green: #a6e3a1;
+ $teal: #94e2d5;
+ $sky: #89dceb;
+ $sapphire: #74c7ec;
+ $blue: #89b4fa;
+ $lavender: #b4befe;
+// Default Theme Color Palette
+
+// Red
Expand Down
46 changes: 46 additions & 0 deletions patches/colloid/theme-func.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
diff --git a/src/sass/_colors.scss b/src/sass/_colors.scss
index 8738bf37..71797c6d 100644
--- a/src/sass/_colors.scss
+++ b/src/sass/_colors.scss
@@ -58,27 +58,20 @@
}

@function theme($color) {
- @if ($variant == 'light') {
- @if ($theme == 'default') { @return $default-dark; }
- @if ($theme == 'purple') { @return $purple-dark; }
- @if ($theme == 'pink') { @return $pink-dark; }
- @if ($theme == 'red') { @return $red-dark; }
- @if ($theme == 'orange') { @return $orange-dark; }
- @if ($theme == 'yellow') { @return $yellow-dark; }
- @if ($theme == 'green') { @return $green-dark; }
- @if ($theme == 'teal') { @return $teal-dark; }
- @if ($theme == 'grey') { @return $grey-600; }
- } @else {
- @if ($theme == 'default') { @return $default-light; }
- @if ($theme == 'purple') { @return $purple-light; }
- @if ($theme == 'pink') { @return $pink-light; }
- @if ($theme == 'red') { @return $red-light; }
- @if ($theme == 'orange') { @return $orange-light; }
- @if ($theme == 'yellow') { @return $yellow-light; }
- @if ($theme == 'green') { @return $green-light; }
- @if ($theme == 'teal') { @return $teal-light; }
- @if ($theme == 'grey') { @return $grey-200; }
- }
+ @if ($theme == 'rosewater') { @return $rosewater; }
+ @if ($theme == 'flamingo') { @return $flamingo; }
+ @if ($theme == 'pink') { @return $pink; }
+ @if ($theme == 'mauve') { @return $mauve; }
+ @if ($theme == 'red') { @return $red; }
+ @if ($theme == 'maroon') { @return $maroon; }
+ @if ($theme == 'peach') { @return $peach; }
+ @if ($theme == 'yellow') { @return $yellow; }
+ @if ($theme == 'green') { @return $green; }
+ @if ($theme == 'teal') { @return $teal; }
+ @if ($theme == 'sky') { @return $sky; }
+ @if ($theme == 'sapphire') { @return $sapphire; }
+ @if ($theme == 'blue') { @return $blue; }
+ @if ($theme == 'lavender') { @return $lavender; }
}

@function background($type) {