Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd76d695

Browse files
authored
feat: allow manually installing different accent colors (#47)
Note: automatic (HACS) installations still only support the default mauve theme. If you want a different accent color you will need to follow the manual installation instructions in the README.
1 parent54c9c88 commitd76d695

File tree

5 files changed

+52
-40
lines changed

5 files changed

+52
-40
lines changed

‎.github/workflows/release.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ jobs:
2929
if:${{ needs.release-please.outputs.release_created }}
3030
steps:
3131
-uses:actions/checkout@v5
32+
-uses:catppuccin/setup-whiskers@v2
33+
34+
-name:Generate themes
35+
run:whiskers home-assistant.tera
3236

3337
-name:Upload Theme Assets
3438
env:
3539
GH_TOKEN:${{ github.token }}
36-
run:gh release upload ${{ needs.release-please.outputs.tag_name }} themes/* --clobber
40+
run:gh release upload ${{ needs.release-please.outputs.tag_name }} themes/catppuccin-*.yaml --clobber

‎.github/workflows/validate.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@ jobs:
2323
steps:
2424
-uses:actions/checkout@v5
2525
-uses:catppuccin/setup-whiskers@v2
26-
-run:whiskers home-assistant.tera --check themes/catppuccin.yaml
26+
-name:Generate themes
27+
run:whiskers home-assistant.tera
28+
-name:Ensure generating themes didn't change anything
29+
run:git diff --exit-code

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ignore all non-default accents
2+
/themes/catppuccin-*.yaml

‎README.md‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,10 @@ frontend:
8686
...# your configuration.
8787
```
8888

89-
90-
2. Download the`catppuccin.yaml` file from the[latest GitHub release](https://github.com/catppuccin/home-assistant/releases/latest).
91-
92-
3. Move the downloaded file to the`themes` folder in your
89+
2. Download your preferred theme(s) from the[latest GitHub release](https://github.com/catppuccin/home-assistant/releases/latest) (the screenshots use`mauve`).
90+
3. Move the downloaded file(s) to the`themes` folder in your
9391
[HA configuration directory](https://www.home-assistant.io/docs/configuration/#to-find-the-configuration-directory). (E.g.`~/config/themes`)
94-
9592
4. Run the`frontend.reload_themes` action or restart Home Assistant.
96-
9793
5. Go to the[Profile General tab](https://my.home-assistant.io/redirect/profile) and change Theme under Browser Settings to your desired theme.
9894

9995
##💝 Thanks to

‎home-assistant.tera‎

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
---
22
whiskers:
33
version: "^2.5.1"
4-
filename: "themes/catppuccin.yaml"
4+
matrix:
5+
- accent: ["default", "rosewater", "flamingo", "pink", "mauve", "red", "maroon", "peach", "yellow", "green", "teal", "sky", "sapphire", "blue", "lavender"]
6+
filename: "themes/{% if accent == 'default' %}catppuccin.yaml{% else %}catppuccin-{{accent}}.yaml{% endif %}"
7+
graph_color_offsets: {"mauve": 0, "green": 1, "red": 2, "blue": 3, "pink": 4, "yellow": 5, "sky": 6, "maroon": 7, "lavender": 8, "peach": 9, "teal": 10, "rosewater": 11, "sapphire": 12, "flamingo": 13}
8+
graph_colors: ["mauve", "green", "red", "blue", "pink", "yellow", "sky", "maroon", "lavender", "peach", "teal", "rosewater", "sapphire", "flamingo"]
59
---
6-
10+
{%- if accent == 'default' -%}
11+
{%- set is_default = true -%}
12+
{%- set accent = 'mauve' -%}
13+
{%- endif -%}
714
{%- for _, flavor in flavors -%}
8-
Catppuccin {{ flavor.identifier | capitalize }}:
15+
Catppuccin {{ flavor.identifier | capitalize }}{% if not is_default %} {{ accent | capitalize }}{% endif %}:
916
modes:
1017
{% if flavor.dark %}dark{% else %}light{% endif %}: &{{ flavor.identifier }}
1118
#####################
@@ -25,17 +32,17 @@ Catppuccin {{ flavor.identifier | capitalize }}:
2532
# Primary
2633
# NOTE: This centers around `primary-40` rather than `primary-50` because
2734
# HA uses `-40` as the default brand color for some reason.
28-
ha-color-primary-05: {{ flavor.colors.mauve | mix(color=flavor.colors.text, amount=0.125) | css_rgb }}
29-
ha-color-primary-10: {{ flavor.colors.mauve | mix(color=flavor.colors.text, amount=0.25) | css_rgb }}
30-
ha-color-primary-20: {{ flavor.colors.mauve | mix(color=flavor.colors.text, amount=0.5) | css_rgb }}
31-
ha-color-primary-30: {{ flavor.colors.mauve | mix(color=flavor.colors.text, amount=0.75) | css_rgb }}
32-
ha-color-primary-40: {{ flavor.colors.mauve | css_rgb }}
33-
ha-color-primary-50: {{ flavor.colors.mauve | mix(color=flavor.colors.base, amount=0.833333331) | css_rgb }}
34-
ha-color-primary-60: {{ flavor.colors.mauve | mix(color=flavor.colors.base, amount=0.666666671) | css_rgb }}
35-
ha-color-primary-70: {{ flavor.colors.mauve | mix(color=flavor.colors.base, amount=0.51) | css_rgb }}
36-
ha-color-primary-80: {{ flavor.colors.mauve | mix(color=flavor.colors.base, amount=0.333333331) | css_rgb }}
37-
ha-color-primary-90: {{ flavor.colors.mauve | mix(color=flavor.colors.base, amount=0.166666671) | css_rgb }}
38-
ha-color-primary-95: {{ flavor.colors.mauve | mix(color=flavor.colors.base, amount=0.083333331) | css_rgb }}
35+
ha-color-primary-05: {{ flavor.colors[accent] | mix(color=flavor.colors.text, amount=0.125) | css_rgb }}
36+
ha-color-primary-10: {{ flavor.colors[accent] | mix(color=flavor.colors.text, amount=0.25) | css_rgb }}
37+
ha-color-primary-20: {{ flavor.colors[accent] | mix(color=flavor.colors.text, amount=0.5) | css_rgb }}
38+
ha-color-primary-30: {{ flavor.colors[accent] | mix(color=flavor.colors.text, amount=0.75) | css_rgb }}
39+
ha-color-primary-40: {{ flavor.colors[accent] | css_rgb }}
40+
ha-color-primary-50: {{ flavor.colors[accent] | mix(color=flavor.colors.base, amount=0.833333331) | css_rgb }}
41+
ha-color-primary-60: {{ flavor.colors[accent] | mix(color=flavor.colors.base, amount=0.666666671) | css_rgb }}
42+
ha-color-primary-70: {{ flavor.colors[accent] | mix(color=flavor.colors.base, amount=0.51) | css_rgb }}
43+
ha-color-primary-80: {{ flavor.colors[accent] | mix(color=flavor.colors.base, amount=0.333333331) | css_rgb }}
44+
ha-color-primary-90: {{ flavor.colors[accent] | mix(color=flavor.colors.base, amount=0.166666671) | css_rgb }}
45+
ha-color-primary-95: {{ flavor.colors[accent] | mix(color=flavor.colors.base, amount=0.083333331) | css_rgb }}
3946

4047
# Neutral
4148
ha-color-neutral-05: {{ flavor.colors.base | mix(color=flavor.colors.text, amount=0.05) | css_rgb }}
@@ -264,8 +271,8 @@ Catppuccin {{ flavor.identifier | capitalize }}:
264271
outline-hover-color: var(--catppuccin-surface2)
265272

266273
# RGB
267-
rgb-primary-color: var(--catppuccin-mauve-rgb)
268-
rgb-accent-color: var(--catppuccin-mauve-rgb)
274+
rgb-primary-color: var(--catppuccin-{{ accent }}-rgb)
275+
rgb-accent-color: var(--catppuccin-{{ accent }}-rgb)
269276
rgb-primary-text-color: var(--catppuccin-text-rgb)
270277
rgb-secondary-text-color: var(--catppuccin-subtext1-rgb)
271278
rgb-text-primary-color: var(--catppuccin-text-rgb)
@@ -346,7 +353,7 @@ Catppuccin {{ flavor.identifier | capitalize }}:
346353
input-dropdown-icon-color: var(--secondary-text-color)
347354

348355
# State color
349-
state-active-color: var(--catppuccin-mauve)
356+
state-active-color: var(--catppuccin-{{ accent }})
350357

351358
sidebar-background-color: var(--catppuccin-crust)
352359
switch-unchecked-color: var(--catppuccin-overlay0)
@@ -392,27 +399,27 @@ Catppuccin {{ flavor.identifier | capitalize }}:
392399
##########
393400
# Graphs #
394401
##########
395-
graph-color-1: var(--catppuccin-mauve)
396-
graph-color-2: var(--catppuccin-green)
397-
graph-color-3: var(--catppuccin-red)
398-
graph-color-4: var(--catppuccin-blue)
399-
graph-color-5: var(--catppuccin-pink)
400-
graph-color-6: var(--catppuccin-yellow)
401-
graph-color-7: var(--catppuccin-sky)
402-
graph-color-8: var(--catppuccin-maroon)
403-
graph-color-9: var(--catppuccin-lavender)
404-
graph-color-10: var(--catppuccin-peach)
405-
graph-color-11: var(--catppuccin-teal)
406-
graph-color-12: var(--catppuccin-rosewater)
407-
graph-color-13: var(--catppuccin-sapphire)
408-
graph-color-14: var(--catppuccin-flamingo)
402+
graph-color-1: var(--catppuccin-{{ graph_colors | nth(n=(graph_color_offsets[accent] + 0) % 14) }})
403+
graph-color-2: var(--catppuccin-{{ graph_colors | nth(n=(graph_color_offsets[accent] + 1) % 14) }})
404+
graph-color-3: var(--catppuccin-{{ graph_colors | nth(n=(graph_color_offsets[accent] + 2) % 14) }})
405+
graph-color-4: var(--catppuccin-{{ graph_colors | nth(n=(graph_color_offsets[accent] + 3) % 14) }})
406+
graph-color-5: var(--catppuccin-{{ graph_colors | nth(n=(graph_color_offsets[accent] + 4) % 14) }})
407+
graph-color-6: var(--catppuccin-{{ graph_colors | nth(n=(graph_color_offsets[accent] + 5) % 14) }})
408+
graph-color-7: var(--catppuccin-{{ graph_colors | nth(n=(graph_color_offsets[accent] + 6) % 14) }})
409+
graph-color-8: var(--catppuccin-{{ graph_colors | nth(n=(graph_color_offsets[accent] + 7) % 14) }})
410+
graph-color-9: var(--catppuccin-{{ graph_colors | nth(n=(graph_color_offsets[accent] + 8) % 14) }})
411+
graph-color-10: var(--catppuccin-{{ graph_colors | nth(n=(graph_color_offsets[accent] + 9) % 14) }})
412+
graph-color-11: var(--catppuccin-{{ graph_colors | nth(n=(graph_color_offsets[accent] + 10) % 14) }})
413+
graph-color-12: var(--catppuccin-{{ graph_colors | nth(n=(graph_color_offsets[accent] + 11) % 14) }})
414+
graph-color-13: var(--catppuccin-{{ graph_colors | nth(n=(graph_color_offsets[accent] + 12) % 14) }})
415+
graph-color-14: var(--catppuccin-{{ graph_colors | nth(n=(graph_color_offsets[accent] + 13) % 14) }})
409416
{% endfor -%}
410417

411418
{% for _, light_flavor in flavors -%}
412419
{%- if not light_flavor.dark -%}
413420
{%- for _, dark_flavor in flavors -%}
414421
{%- if dark_flavor.dark -%}
415-
Catppuccin Auto {{ light_flavor.identifier | capitalize }} {{ dark_flavor.identifier | capitalize }}:
422+
Catppuccin Auto {{ light_flavor.identifier | capitalize }} {{ dark_flavor.identifier | capitalize }}{% if not is_default %} {{ accent | capitalize }}{% endif %}:
416423
modes:
417424
light: *{{ light_flavor.identifier }}
418425
dark: *{{ dark_flavor.identifier }}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp