Iterate on the themes.

Always white text
This commit is contained in:
Magnus Hoff 2018-07-20 23:35:33 +02:00
parent d3a50b0bc0
commit c18b8f45d1
2 changed files with 21 additions and 24 deletions

View file

@ -48,9 +48,9 @@
} }
.theme-cyan { .theme-cyan {
--theme-main: #0097A7; --theme-main: #00ACC1;
--theme-text: white; --theme-text: white;
--theme-input: #00BCD4; --theme-input: #26C6DA;
--theme-link: #90CAF9; --theme-link: #90CAF9;
} }
@ -69,37 +69,37 @@
} }
.theme-light-green { .theme-light-green {
--theme-main: #689F38; --theme-main: #7CB342;
--theme-text: white; --theme-text: white;
--theme-input: #8BC34A; --theme-input: #9CCC65;
--theme-link: #90CAF9; --theme-link: #90CAF9;
} }
.theme-lime { .theme-lime {
--theme-main: #D4E157; --theme-main: #C0CA33;
--theme-text: black; --theme-text: white;
--theme-input: #E6EE9C; --theme-input: #AFB42B;
--theme-link: #1976D2; --theme-link: #1976D2;
} }
.theme-yellow { .theme-yellow {
--theme-main: #FFEE58; --theme-main: #FDD835;
--theme-text: black; --theme-text: white;
--theme-input: #FFF59D; --theme-input: #FBC02D;
--theme-link: #1976D2; --theme-link: #1976D2;
} }
.theme-amber { .theme-amber {
--theme-main: #FFCA28; --theme-main: #FFB300;
--theme-text: black; --theme-text: white;
--theme-input: #FFE082; --theme-input: #FFA000;
--theme-link: #1976D2; --theme-link: #1976D2;
} }
.theme-orange { .theme-orange {
--theme-main: #F57C00; --theme-main: #FB8C00;
--theme-text: white; --theme-text: white;
--theme-input: #FF9800; --theme-input: #FFA726;
--theme-link: #90CAF9; --theme-link: #90CAF9;
} }

View file

@ -26,22 +26,19 @@ def prep(x):
rgb = [hex_to_rgb(c[1:]) for c in cols] rgb = [hex_to_rgb(c[1:]) for c in cols]
brightness = [luma(c) for c in rgb] brightness = [luma(c) for c in rgb]
dark_main = True
main_index = 5 main_index = 5
if brightness[main_index] >= 0.4: if brightness[main_index] >= 0.4:
main_index = 7 main_index = 6
if brightness[main_index] >= 0.4: dark_main = brightness[main_index] < 0.5
dark_main = False
main_index = 4 input_index = main_index + (-2 if dark_main else 1)
if brightness[main_index] < 0.6:
main_index = 3
return { return {
"name": x['shade'].lower().replace(' ', '-'), "name": x['shade'].lower().replace(' ', '-'),
"main": cols[main_index], "main": cols[main_index],
"input": x['colors'][main_index - 2], "input": cols[input_index],
"text": "white" if dark_main else "black", "text": "white",
"link": blues[2] if dark_main else blues[7], "link": blues[2] if dark_main else blues[7],
} }