mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-01-10 07:58:12 +01:00
themes: Add support for terminal.sexy json
This commit is contained in:
parent
a95d901dea
commit
90a73edda5
@ -127,6 +127,24 @@ def get(img, cache_dir=CACHE_DIR,
|
||||
return colors
|
||||
|
||||
|
||||
def terminal_sexy_to_wal(data):
|
||||
"""Convert terminal.sexy json schema to wal."""
|
||||
data["colors"] = {}
|
||||
data["special"] = {}
|
||||
|
||||
for i in range(0, 16):
|
||||
data["colors"]["color%s" % i] = data["color"][i if i < 9 else i - 8]
|
||||
|
||||
data["colors"]["color0"] = data["background"]
|
||||
data["colors"]["color7"] = data["foreground"]
|
||||
data["colors"]["color15"] = data["foreground"]
|
||||
data["special"]["foreground"] = data["foreground"]
|
||||
data["special"]["background"] = data["background"]
|
||||
data["special"]["cursor"] = data["colors"]["color1"]
|
||||
|
||||
return data
|
||||
|
||||
|
||||
def file(input_file):
|
||||
"""Import colorscheme from json file."""
|
||||
theme_file = os.path.join(MODULE_DIR, "colorschemes",
|
||||
@ -144,6 +162,10 @@ def file(input_file):
|
||||
if "alpha" not in data:
|
||||
data["alpha"] = "100"
|
||||
|
||||
# Terminal.sexy format.
|
||||
if isinstance(data["color"], list):
|
||||
data = terminal_sexy_to_wal(data)
|
||||
|
||||
return data
|
||||
|
||||
else:
|
||||
|
@ -2,7 +2,7 @@
|
||||
"special": {
|
||||
"background": "#282828",
|
||||
"foreground": "#a89984",
|
||||
"cursor": "#dc322f"
|
||||
"cursor": "#cc241d"
|
||||
},
|
||||
"colors": {
|
||||
"color0": "#282828",
|
||||
|
25
pywal/colorschemes/zenburn.json
Normal file
25
pywal/colorschemes/zenburn.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"special": {
|
||||
"background": "#3f3f3f",
|
||||
"foreground": "#dcdccc",
|
||||
"cursor": "#cc9393"
|
||||
},
|
||||
"colors": {
|
||||
"color0": "#3f3f3f",
|
||||
"color1": "#cc9393",
|
||||
"color2": "#7f9f7f",
|
||||
"color3": "#d0bf8f",
|
||||
"color4": "#6ca0a3",
|
||||
"color5": "#dc8cc3",
|
||||
"color6": "#93e0e3",
|
||||
"color7": "#dcdccc",
|
||||
"color8": "#828282",
|
||||
"color9": "#cc9393",
|
||||
"color10": "#7f9f7f",
|
||||
"color11": "#d0bf8f",
|
||||
"color12": "#6ca0a3",
|
||||
"color13": "#dc8cc3",
|
||||
"color14": "#93e0e3",
|
||||
"color15": "#dcdccc"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user