Skip to content

Commit

Permalink
feat(oomox_plugin): export all themix vars as well with base16 ones
Browse files Browse the repository at this point in the history
  • Loading branch information
actionless committed Feb 26, 2022
1 parent 03ae081 commit f601ab1
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions oomox_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

# Enable Base16 export if pystache and yaml are installed:
try:
import pystache # noqa pylint: disable=unused-import
import yaml # noqa pylint: disable=unused-import
import pystache # noqa
import yaml # noqa
except ImportError:
# @TODO: replace to error dialog:
print(
Expand Down Expand Up @@ -96,6 +96,11 @@ def convert_oomox_to_base16(theme_name, colorscheme):
base16_theme['base08'], base16_theme['base09'], 0.5
), 20)

for key, value in colorscheme.items():
base16_theme[f'themix_{key}'] = value

# from pprint import pprint; pprint(base16_theme)

return base16_theme


Expand All @@ -104,7 +109,12 @@ def convert_base16_to_template_data(base16_theme):
for key, value in base16_theme.items():
if not key.startswith('base'):
base16_data[key] = value
continue
try:
# @TODO: check theme model for color types only:
color_list_from_hex(value)
int_list_from_hex(value)
except Exception:
continue

hex_key = key + '-hex'
base16_data[hex_key] = value
Expand Down

0 comments on commit f601ab1

Please sign in to comment.