mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-01-23 22:38:36 +01:00
colors: Store generated colors in a dict to later export to json.
This commit is contained in:
parent
950400ef7d
commit
8a908de48c
@ -90,7 +90,7 @@ def process_args(args):
|
||||
|
||||
# Create a list of hex colors.
|
||||
colors_plain = gen_colors.get_colors(image, args.q)
|
||||
colors_plain[8] = set_colors.set_grey(colors_plain)
|
||||
# colors_plain[8] = set_colors.set_grey(colors_plain)
|
||||
|
||||
if not args.n:
|
||||
wallpaper.set_wallpaper(image)
|
||||
|
@ -122,4 +122,22 @@ def get_colors(img, quiet):
|
||||
|
||||
def sort_colors(colors):
|
||||
"""Sort the generated colors."""
|
||||
return colors[:1] + colors[9:] + colors[8:]
|
||||
raw_colors = colors[:1] + colors[9:] + colors[8:]
|
||||
|
||||
# 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_hex = {}
|
||||
[colors_hex.update({f"color{index}": color}) # pylint: disable=W0106
|
||||
for index, color in enumerate(raw_colors)]
|
||||
|
||||
# Add the colors to a dict.
|
||||
colors = {}
|
||||
colors["special"] = colors_special
|
||||
colors["colors"] = colors_hex
|
||||
|
||||
return colors
|
||||
|
Loading…
Reference in New Issue
Block a user