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

Commit

Permalink
fix: use old palette; apply OLED mode with black tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
nullishamy committed May 24, 2024
1 parent 9e0bfa3 commit 8b97c86
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 438 deletions.
20 changes: 8 additions & 12 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Suffix:
false_value: str = ""


IS_OLED = Suffix(true_value='-oled', false_value='-standard', test=lambda ctx: ctx.tweaks.has('oled'))
IS_OLED = Suffix(true_value='-oled', false_value='-standard', test=lambda ctx: ctx.tweaks.has('black'))
IS_DARK = Suffix(true_value="-Dark", test=lambda ctx: ctx.flavor.dark)
IS_LIGHT = Suffix(true_value="-Light", test=lambda ctx: not ctx.flavor.dark)
IS_WINDOW_NORMAL = Suffix(true_value="-Normal", test=lambda ctx: ctx.tweaks.has('normal'))
Expand Down Expand Up @@ -191,11 +191,11 @@ def build(ctx: BuildContext):

if not ctx.flavor.dark:
shutil.copytree(
f"{SRC_DIR}/main/plank/theme-Light-Catppuccin/", f"{output_dir}/plank"
f"{SRC_DIR}/main/plank/theme-Light-Catppuccin/", f"{output_dir}/plank", dirs_exist_ok=True
)
else:
shutil.copytree(
f"{SRC_DIR}/main/plank/theme-Dark-Catppuccin/", f"{output_dir}/plank"
f"{SRC_DIR}/main/plank/theme-Dark-Catppuccin/", f"{output_dir}/plank", dirs_exist_ok=True
)


Expand Down Expand Up @@ -271,7 +271,7 @@ def apply_tweaks(ctx: BuildContext):
subst_text(
f"{SRC_DIR}/sass/_tweaks-temp.scss",
"@import 'color-palette-default';",
f"@import 'color-palette-catppuccin-{ctx.flavor.identifier}{ctx.apply_suffix(IS_OLED)}';",
f"@import 'color-palette-catppuccin-{ctx.flavor.identifier}';",
)
write_tweak("colorscheme", "'default'", "'catppuccin'")

Expand Down Expand Up @@ -477,14 +477,10 @@ def apply_colloid_patches():
for patch in [
"plank-dark.patch",
"plank-light.patch",
"sass-palette-frappe-standard.patch",
"sass-palette-mocha-standard.patch",
"sass-palette-latte-standard.patch",
"sass-palette-macchiato-standard.patch",
"sass-palette-frappe-oled.patch",
"sass-palette-mocha-oled.patch",
"sass-palette-latte-oled.patch",
"sass-palette-macchiato-oled.patch",
"sass-palette-frappe.patch",
"sass-palette-mocha.patch",
"sass-palette-latte.patch",
"sass-palette-macchiato.patch",
]:
path = f"./patches/colloid/{patch}"
logger.info(f"Applying patch '{patch}', located at '{path}'")
Expand Down
80 changes: 31 additions & 49 deletions patches/colloid/palette.tera
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ whiskers:
version: 2.1.0
matrix:
- flavor
- variant: [ 'oled', 'standard' ]
filename: 'sass-palette-{{ flavor.identifier }}-{{ variant }}.patch'
filename: 'sass-palette-{{ flavor.identifier }}.patch'
---
{%- set palette = flavor.colors -%}
diff --git a/src/sass/_color-palette-catppuccin-{{ flavor.identifier }}-{{ variant }}.scss b/src/sass/_color-palette-catppuccin-{{ flavor.identifier }}-{{ variant }}.scss
diff --git a/src/sass/_color-palette-catppuccin-{{ flavor.identifier }}.scss b/src/sass/_color-palette-catppuccin-{{ flavor.identifier }}.scss
new file mode 100644
index 00000000..8a905942
--- /dev/null
+++ b/src/sass/_color-palette-catppuccin-{{ flavor.identifier }}-{{ variant }}.scss
+++ b/src/sass/_color-palette-catppuccin-{{ flavor.identifier }}.scss
@@ -0,0 +1,72 @@
+// Default Theme Color Palette
+
Expand Down Expand Up @@ -48,70 +47,53 @@ index 00000000..8a905942
+$orange-dark: #{{ palette.peach.hex }};
+
+// Grey
{% if flavor.dark -%}
+$grey-050: #{{ palette.text.hex }};
+$grey-100: #{{ palette.text.hex }};
+$grey-150: #{{ palette.subtext1.hex }};
+$grey-200: #{{ palette.subtext0.hex }};
+$grey-250: #{{ palette.overlay2.hex }};
+$grey-300: #{{ palette.overlay1.hex }};
+$grey-350: #{{ palette.overlay1.hex }};
+$grey-400: #{{ palette.overlay0.hex }};
+$grey-450: #{{ palette.surface2.hex }};
+$grey-500: #{{ palette.surface1.hex }};
+$grey-550: #{{ palette.surface1.hex }};
+$grey-600: #{{ palette.surface0.hex }};
{% if flavor.dark -%} {#- https://github.com/catppuccin/gtk/blob/0c3e8817da94769887c690b2211e006b287b27b1/scripts/recolor.py#L153-L176 -#}
+$grey-050: #{{ palette.overlay2.hex }};
+$grey-100: #{{ palette.overlay1.hex }};
+$grey-150: #{{ palette.overlay0.hex }};
+$grey-200: #{{ palette.surface2.hex }};
+$grey-250: #{{ palette.surface1.hex }};
+$grey-300: #BFBFBF;
+$grey-350: #A0A0A0;
+$grey-400: #9E9E9E;
+$grey-450: #868686;
+$grey-500: #727272;
+$grey-550: #555555;
+$grey-600: #464646;
+$grey-650: #{{ palette.surface0.hex }};
+$grey-700: #{{ palette.base.hex }};
+$grey-750: #{{ palette.mantle.hex }};
+$grey-800: #{{ palette.mantle.hex }};
{% if variant == "standard" -%} {#- Regular colours, dark mode -#}
+$grey-850: #{{ palette.mantle.hex }};
+$grey-900: #{{ palette.crust.hex }};
+$grey-950: #{{ palette.crust.hex }};
{%- else -%} {#- OLED colours, dark mode -#}
+$grey-750: #{{ palette.crust.hex }};
+$grey-800: #{{ palette.crust.hex }};
+$grey-850: #020202;
+$grey-900: #010101;
+$grey-950: #000000;
{%- endif %}
{%- else -%} {#- Light mode -#}
+$grey-050: #{{ palette.base.hex }};
{%- else -%} {#- Light mode https://github.com/catppuccin/gtk/blob/0c3e8817da94769887c690b2211e006b287b27b1/scripts/recolor.py#L128-L151 -#}
+$grey-050: #{{ palette.crust.hex }};
+$grey-100: #{{ palette.mantle.hex }};
+$grey-150: #{{ palette.mantle.hex }};
+$grey-200: #{{ palette.mantle.hex }};
+$grey-250: #{{ palette.crust.hex }};
+$grey-300: #{{ palette.crust.hex }};
+$grey-350: #{{ palette.surface0.hex }};
+$grey-400: #{{ palette.surface1.hex }};
+$grey-450: #{{ palette.surface1.hex }};
+$grey-500: #{{ palette.surface2.hex }};
+$grey-550: #{{ palette.surface2.hex }};
+$grey-600: #{{ palette.overlay0.hex }};
+$grey-150: #{{ palette.base.hex }};
+$grey-200: #{{ palette.surface0.hex }};
+$grey-250: #{{ palette.surface1.hex }};
+$grey-300: #BFBFBF;
+$grey-350: #A0A0A0;
+$grey-400: #9E9E9E;
+$grey-450: #868686;
+$grey-500: #727272;
+$grey-550: #555555;
+$grey-600: #464646;
+$grey-650: #{{ palette.overlay1.hex }};
+$grey-700: #{{ palette.base.hex }};
+$grey-750: #{{ palette.crust.hex }};
+$grey-800: #{{ palette.subtext0.hex }};
{% if variant == "standard" -%} {#- Regular colours, light mode -#}
+$grey-850: #{{ palette.subtext1.hex }};
+$grey-900: #{{ palette.text.hex }};
+$grey-950: #{{ palette.text.hex }};
{%- else -%} {#- OLED colours, light mode -#}
+$grey-850: #020202;
+$grey-900: #010101;
+$grey-950: #000000;
{%- endif %}
{%- endif %}
+
+// White
+$white: #{{ if(cond=flavor.dark, t=palette.text.hex, f=palette.base.hex) }};
+$white: #FFFFFF;
+
{% if variant == "standard" -%}
+// Black
+$black: #{{ if(cond=flavor.dark, t=palette.crust.hex, f=palette.text.hex) }};
{% else -%}
+// Black
+$black: #000000;
{% endif -%}
+
+// Button
+$button-close: #{{ palette.red.hex }};
Expand Down
78 changes: 0 additions & 78 deletions patches/colloid/sass-palette-frappe-standard.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/src/sass/_color-palette-catppuccin-frappe-oled.scss b/src/sass/_color-palette-catppuccin-frappe-oled.scss
diff --git a/src/sass/_color-palette-catppuccin-frappe.scss b/src/sass/_color-palette-catppuccin-frappe.scss
new file mode 100644
index 00000000..8a905942
--- /dev/null
+++ b/src/sass/_color-palette-catppuccin-frappe-oled.scss
+++ b/src/sass/_color-palette-catppuccin-frappe.scss
@@ -0,0 +1,72 @@
+// Default Theme Color Palette
+
Expand Down Expand Up @@ -39,28 +39,28 @@ index 00000000..8a905942
+$orange-dark: #ef9f76;
+
+// Grey
+$grey-050: #c6d0f5;
+$grey-100: #c6d0f5;
+$grey-150: #b5bfe2;
+$grey-200: #a5adce;
+$grey-250: #949cbb;
+$grey-300: #838ba7;
+$grey-350: #838ba7;
+$grey-400: #737994;
+$grey-450: #626880;
+$grey-500: #51576d;
+$grey-550: #51576d;
+$grey-600: #414559;
+$grey-050: #949cbb;
+$grey-100: #838ba7;
+$grey-150: #737994;
+$grey-200: #626880;
+$grey-250: #51576d;
+$grey-300: #BFBFBF;
+$grey-350: #A0A0A0;
+$grey-400: #9E9E9E;
+$grey-450: #868686;
+$grey-500: #727272;
+$grey-550: #555555;
+$grey-600: #464646;
+$grey-650: #414559;
+$grey-700: #303446;
+$grey-750: #292c3c;
+$grey-800: #292c3c;
+$grey-750: #232634;
+$grey-800: #232634;
+$grey-850: #020202;
+$grey-900: #010101;
+$grey-950: #000000;
+
+// White
+$white: #c6d0f5;
+$white: #FFFFFF;
+
+// Black
+$black: #000000;
Expand Down
78 changes: 0 additions & 78 deletions patches/colloid/sass-palette-latte-standard.patch

This file was deleted.

Loading

0 comments on commit 8b97c86

Please sign in to comment.