summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2017-08-10 00:40:19 +1000
committerDylan Araps <dylan.araps@gmail.com>2017-08-10 00:40:19 +1000
commitc9f0ad292130e440faca7e83bf0adfef0362af9f (patch)
treedaff0f41fa0b7028389ce88761b98d4e07690ed2
parent0b8e6749f3bb7d351f62ddd2c19f01118a4d3d5c (diff)
colors: Use an ordered dict to store the colors.
-rw-r--r--pywal/colors.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/pywal/colors.py b/pywal/colors.py
index 7a1a991..a501344 100644
--- a/pywal/colors.py
+++ b/pywal/colors.py
@@ -1,6 +1,7 @@
"""
Generate a colorscheme using imagemagick.
"""
+import collections
import re
import shutil
import subprocess
@@ -64,19 +65,17 @@ def sort_colors(img, colors):
# Create a comment color from the background.
raw_colors[8] = util.lighten_color(raw_colors[0], 0.40)
- colors = {"wallpaper": img}
- colors_special = {}
- colors_hex = {}
+ colors = {}
+ colors["wallpaper"] = img
+ colors["special"] = {}
+ colors["colors"] = collections.OrderedDict()
- colors_special.update({"background": raw_colors[0]})
- colors_special.update({"foreground": raw_colors[15]})
- colors_special.update({"cursor": raw_colors[15]})
+ colors["special"]["background"] = raw_colors[0]
+ colors["special"]["foreground"] = raw_colors[15]
+ colors["special"]["cursor"] = raw_colors[15]
for index, color in enumerate(raw_colors):
- colors_hex.update({"color%s" % index: color})
-
- colors["special"] = colors_special
- colors["colors"] = colors_hex
+ colors["colors"]["color%s" % index] = color
return colors