Skip to content

Commit

Permalink
Make alternative theme in folder
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Sep 7, 2024
1 parent 45b7883 commit 54f1b7d
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 35 deletions.
19 changes: 13 additions & 6 deletions create-themes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from pathlib import Path

import base64
import jinja2
import yaml
from PIL import Image
Expand All @@ -15,7 +14,10 @@

COMMIT = "a37376d918fcfe4785be99910dc9a7200ac37da9"

BASE_URL = f"https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/{COMMIT}/themes"
BASE_URL = (
f"https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/{COMMIT}/themes"
)


def parse(x):
return x if "#" not in x else f'"{x}"'
Expand All @@ -32,6 +34,10 @@ def fname_to_url(fname):
return f"{BASE_URL}/{fname.name}"


def fname_to_local_path(folder, background):
return f"{folder}/themes/ios-themes/{background.name}"


BACKGROUND_COLORS = {
# Suggested by @okets in issue #42
"blue-red": "rgba(30, 2, 61, 0.4)",
Expand Down Expand Up @@ -59,10 +65,10 @@ def fname_to_url(fname):
else:
app_header_background_color = average_color(background)
for which in ["light", "dark"]:
for state_icon_yellow in [False, True]:
for standard in [False, True]:
settings = {k: parse(v[which]) for k, v in all_settings.items()}

if state_icon_yellow:
if standard:
settings["state_icon_active_color"] = "rgba(255, 214, 10, 1)"
suffix = ""
else:
Expand All @@ -76,8 +82,9 @@ def fname_to_url(fname):
folder=folder,
which=which,
app_header_background_color=app_header_background_color,
background_jpg=fname_to_url(background),
# background_jpg=str(background.name),
background=fname_to_url(background)
if standard
else fname_to_local_path(folder, background),
color=color,
suffix=suffix,
)
Expand Down
28 changes: 14 additions & 14 deletions manual-install/ios-themes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
ios-light-mode-blue-red-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-blue-red.jpg')"
background-image: "center / cover no-repeat fixed url('local/themes/ios-themes/homekit-bg-blue-red.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9409" # from Apple systemOrange light mode
light-primary-color: "#2c2c2e" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -183,7 +183,7 @@ ios-light-mode-blue-red:
#
ios-dark-mode-blue-red-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-blue-red.jpg')"
background-image: "center / cover no-repeat fixed url('local/themes/ios-themes/homekit-bg-blue-red.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9f09" # from Apple systemOrange dark mode
light-primary-color: "#B6B6C1" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -361,7 +361,7 @@ ios-dark-mode-blue-red:
#
ios-light-mode-dark-blue-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-dark-blue.jpg')"
background-image: "center / cover no-repeat fixed url('local/themes/ios-themes/homekit-bg-dark-blue.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9409" # from Apple systemOrange light mode
light-primary-color: "#2c2c2e" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -539,7 +539,7 @@ ios-light-mode-dark-blue:
#
ios-dark-mode-dark-blue-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-dark-blue.jpg')"
background-image: "center / cover no-repeat fixed url('local/themes/ios-themes/homekit-bg-dark-blue.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9f09" # from Apple systemOrange dark mode
light-primary-color: "#B6B6C1" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -717,7 +717,7 @@ ios-dark-mode-dark-blue:
#
ios-light-mode-dark-green-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-dark-green.jpg')"
background-image: "center / cover no-repeat fixed url('local/themes/ios-themes/homekit-bg-dark-green.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9409" # from Apple systemOrange light mode
light-primary-color: "#2c2c2e" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -895,7 +895,7 @@ ios-light-mode-dark-green:
#
ios-dark-mode-dark-green-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-dark-green.jpg')"
background-image: "center / cover no-repeat fixed url('local/themes/ios-themes/homekit-bg-dark-green.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9f09" # from Apple systemOrange dark mode
light-primary-color: "#B6B6C1" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -1073,7 +1073,7 @@ ios-dark-mode-dark-green:
#
ios-light-mode-light-blue-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-light-blue.jpg')"
background-image: "center / cover no-repeat fixed url('local/themes/ios-themes/homekit-bg-light-blue.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9409" # from Apple systemOrange light mode
light-primary-color: "#2c2c2e" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -1251,7 +1251,7 @@ ios-light-mode-light-blue:
#
ios-dark-mode-light-blue-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-light-blue.jpg')"
background-image: "center / cover no-repeat fixed url('local/themes/ios-themes/homekit-bg-light-blue.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9f09" # from Apple systemOrange dark mode
light-primary-color: "#B6B6C1" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -1429,7 +1429,7 @@ ios-dark-mode-light-blue:
#
ios-light-mode-light-green-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-light-green.jpg')"
background-image: "center / cover no-repeat fixed url('local/themes/ios-themes/homekit-bg-light-green.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9409" # from Apple systemOrange light mode
light-primary-color: "#2c2c2e" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -1607,7 +1607,7 @@ ios-light-mode-light-green:
#
ios-dark-mode-light-green-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-light-green.jpg')"
background-image: "center / cover no-repeat fixed url('local/themes/ios-themes/homekit-bg-light-green.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9f09" # from Apple systemOrange dark mode
light-primary-color: "#B6B6C1" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -1785,7 +1785,7 @@ ios-dark-mode-light-green:
#
ios-light-mode-orange-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-orange.jpg')"
background-image: "center / cover no-repeat fixed url('local/themes/ios-themes/homekit-bg-orange.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9409" # from Apple systemOrange light mode
light-primary-color: "#2c2c2e" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -1963,7 +1963,7 @@ ios-light-mode-orange:
#
ios-dark-mode-orange-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-orange.jpg')"
background-image: "center / cover no-repeat fixed url('local/themes/ios-themes/homekit-bg-orange.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9f09" # from Apple systemOrange dark mode
light-primary-color: "#B6B6C1" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -2141,7 +2141,7 @@ ios-dark-mode-orange:
#
ios-light-mode-red-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-red.jpg')"
background-image: "center / cover no-repeat fixed url('local/themes/ios-themes/homekit-bg-red.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9409" # from Apple systemOrange light mode
light-primary-color: "#2c2c2e" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -2319,7 +2319,7 @@ ios-light-mode-red:
#
ios-dark-mode-red-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-red.jpg')"
background-image: "center / cover no-repeat fixed url('local/themes/ios-themes/homekit-bg-red.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9f09" # from Apple systemOrange dark mode
light-primary-color: "#B6B6C1" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down
2 changes: 1 addition & 1 deletion template.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
ios-{{ which }}-mode-{{ color }}{{ suffix }}:
# Global
background-image: "center / cover no-repeat fixed url('{{ background_jpg }}')"
background-image: "center / cover no-repeat fixed url('{{ background }}')"
lovelace-background: var(--background-image)
primary-color: {{ primary_color }} # from Apple systemOrange {{ which }} mode
light-primary-color: {{ light_primary_color }} # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down
28 changes: 14 additions & 14 deletions themes/ios-themes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
ios-light-mode-blue-red-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-blue-red.jpg')"
background-image: "center / cover no-repeat fixed url('hacsfiles/themes/ios-themes/homekit-bg-blue-red.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9409" # from Apple systemOrange light mode
light-primary-color: "#2c2c2e" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -183,7 +183,7 @@ ios-light-mode-blue-red:
#
ios-dark-mode-blue-red-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-blue-red.jpg')"
background-image: "center / cover no-repeat fixed url('hacsfiles/themes/ios-themes/homekit-bg-blue-red.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9f09" # from Apple systemOrange dark mode
light-primary-color: "#B6B6C1" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -361,7 +361,7 @@ ios-dark-mode-blue-red:
#
ios-light-mode-dark-blue-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-dark-blue.jpg')"
background-image: "center / cover no-repeat fixed url('hacsfiles/themes/ios-themes/homekit-bg-dark-blue.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9409" # from Apple systemOrange light mode
light-primary-color: "#2c2c2e" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -539,7 +539,7 @@ ios-light-mode-dark-blue:
#
ios-dark-mode-dark-blue-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-dark-blue.jpg')"
background-image: "center / cover no-repeat fixed url('hacsfiles/themes/ios-themes/homekit-bg-dark-blue.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9f09" # from Apple systemOrange dark mode
light-primary-color: "#B6B6C1" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -717,7 +717,7 @@ ios-dark-mode-dark-blue:
#
ios-light-mode-dark-green-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-dark-green.jpg')"
background-image: "center / cover no-repeat fixed url('hacsfiles/themes/ios-themes/homekit-bg-dark-green.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9409" # from Apple systemOrange light mode
light-primary-color: "#2c2c2e" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -895,7 +895,7 @@ ios-light-mode-dark-green:
#
ios-dark-mode-dark-green-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-dark-green.jpg')"
background-image: "center / cover no-repeat fixed url('hacsfiles/themes/ios-themes/homekit-bg-dark-green.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9f09" # from Apple systemOrange dark mode
light-primary-color: "#B6B6C1" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -1073,7 +1073,7 @@ ios-dark-mode-dark-green:
#
ios-light-mode-light-blue-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-light-blue.jpg')"
background-image: "center / cover no-repeat fixed url('hacsfiles/themes/ios-themes/homekit-bg-light-blue.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9409" # from Apple systemOrange light mode
light-primary-color: "#2c2c2e" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -1251,7 +1251,7 @@ ios-light-mode-light-blue:
#
ios-dark-mode-light-blue-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-light-blue.jpg')"
background-image: "center / cover no-repeat fixed url('hacsfiles/themes/ios-themes/homekit-bg-light-blue.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9f09" # from Apple systemOrange dark mode
light-primary-color: "#B6B6C1" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -1429,7 +1429,7 @@ ios-dark-mode-light-blue:
#
ios-light-mode-light-green-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-light-green.jpg')"
background-image: "center / cover no-repeat fixed url('hacsfiles/themes/ios-themes/homekit-bg-light-green.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9409" # from Apple systemOrange light mode
light-primary-color: "#2c2c2e" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -1607,7 +1607,7 @@ ios-light-mode-light-green:
#
ios-dark-mode-light-green-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-light-green.jpg')"
background-image: "center / cover no-repeat fixed url('hacsfiles/themes/ios-themes/homekit-bg-light-green.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9f09" # from Apple systemOrange dark mode
light-primary-color: "#B6B6C1" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -1785,7 +1785,7 @@ ios-dark-mode-light-green:
#
ios-light-mode-orange-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-orange.jpg')"
background-image: "center / cover no-repeat fixed url('hacsfiles/themes/ios-themes/homekit-bg-orange.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9409" # from Apple systemOrange light mode
light-primary-color: "#2c2c2e" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -1963,7 +1963,7 @@ ios-light-mode-orange:
#
ios-dark-mode-orange-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-orange.jpg')"
background-image: "center / cover no-repeat fixed url('hacsfiles/themes/ios-themes/homekit-bg-orange.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9f09" # from Apple systemOrange dark mode
light-primary-color: "#B6B6C1" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -2141,7 +2141,7 @@ ios-dark-mode-orange:
#
ios-light-mode-red-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-red.jpg')"
background-image: "center / cover no-repeat fixed url('hacsfiles/themes/ios-themes/homekit-bg-red.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9409" # from Apple systemOrange light mode
light-primary-color: "#2c2c2e" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down Expand Up @@ -2319,7 +2319,7 @@ ios-light-mode-red:
#
ios-dark-mode-red-alternative:
# Global
background-image: "center / cover no-repeat fixed url('https://raw.githubusercontent.com/basnijholt/lovelace-ios-themes/a37376d918fcfe4785be99910dc9a7200ac37da9/themes/homekit-bg-red.jpg')"
background-image: "center / cover no-repeat fixed url('hacsfiles/themes/ios-themes/homekit-bg-red.jpg')"
lovelace-background: var(--background-image)
primary-color: "#ff9f09" # from Apple systemOrange dark mode
light-primary-color: "#B6B6C1" # (icons on left menu) (light: systemGray5 from iOS dark mode, dark: XXX)
Expand Down

0 comments on commit 54f1b7d

Please sign in to comment.