summaryrefslogtreecommitdiff
path: root/pywal/magic.py
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2017-07-10 10:48:01 +1000
committerDylan Araps <dylan.araps@gmail.com>2017-07-10 10:48:01 +1000
commit209196ba8fd30f4e5f48bcb21e67f55a607b5242 (patch)
treeaafb43fd515291c9e94e111afe25e469bf4314c0 /pywal/magic.py
parentbfae735b885e231cb18fe74a4d088e369c4b1b5c (diff)
parenta6f99791ce79f0eed40396e8f3462413ce66554c (diff)
Merge branch 'master' of github.com:dylanaraps/wal.py
Diffstat (limited to 'pywal/magic.py')
-rw-r--r--pywal/magic.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/pywal/magic.py b/pywal/magic.py
index 3af10ce..0cc868a 100644
--- a/pywal/magic.py
+++ b/pywal/magic.py
@@ -75,7 +75,7 @@ def get_colors(img, quiet):
# Generate the colors.
colors = gen_colors(img)
- colors = sort_colors(colors)
+ colors = sort_colors(img, colors)
# Cache the colorscheme.
util.save_file_json(colors, cache_file)
@@ -87,27 +87,29 @@ def get_colors(img, quiet):
return colors
-def sort_colors(colors):
+def sort_colors(img, colors):
"""Sort the generated colors and store them in a dict that
we will later save in json format."""
raw_colors = colors[:1] + colors[9:] + colors[8:]
+ # Wallpaper.
+ colors = {"wallpaper": img}
+
# Special colors.
colors_special = {}
colors_special.update({"background": raw_colors[0]})
colors_special.update({"foreground": raw_colors[15]})
colors_special.update({"cursor": raw_colors[15]})
- # Colors 0-15
+ # Colors 0-15.
colors_hex = {}
[colors_hex.update({f"color{index}": color}) # pylint: disable=W0106
for index, color in enumerate(raw_colors)]
- # Color 8
+ # Color 8.
colors_hex["color8"] = util.set_grey(raw_colors)
# Add the colors to a dict.
- colors = {}
colors["special"] = colors_special
colors["colors"] = colors_hex