Enable Override of autoWeather Default Colors

This commit is contained in:
illuzn
2022-05-25 11:08:09 +09:30
committed by GitHub
parent 52f9f241aa
commit a8db975fc0

View File

@@ -61,11 +61,13 @@ def map_color(key, theme, state=None):
# Use Autocolouring for weather # Use Autocolouring for weather
elif state is not None: elif state is not None:
if key in ["tMainIcon", "tF1Icon", "tF2Icon", "tF3Icon", "tF4Icon"]: if key in ["tMainIcon", "tF1Icon", "tF2Icon", "tF3Icon", "tF4Icon"]:
config_color = map_weather_icon_color(key=key, state=state) config_color = map_weather_icon_color(key=key, theme=theme, state=state)
return config_color return config_color
def map_weather_icon_color(key, state): def map_weather_icon_color(key, theme, state):
if key in state and state[key] in default_weather_icon_color_mapping: if key in state and state[key] in theme:
config_color = rgb_dec565(theme[state[key]])
elif key in state and state[key] in default_weather_icon_color_mapping:
config_color = default_weather_icon_color_mapping[state[key]] config_color = default_weather_icon_color_mapping[state[key]]
else: else:
config_color = "65535" config_color = "65535"