mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-01-26 15:59:10 +01:00
colors: Revert palette changes. Fixes #266
This commit is contained in:
parent
d49caeebfb
commit
ae79aba6e0
@ -35,12 +35,21 @@ def has_im():
|
|||||||
def gen_colors(img):
|
def gen_colors(img):
|
||||||
"""Format the output from imagemagick into a list
|
"""Format the output from imagemagick into a list
|
||||||
of hex colors."""
|
of hex colors."""
|
||||||
raw_colors = imagemagick(20, img, has_im())
|
magick_command = has_im()
|
||||||
|
|
||||||
if len(raw_colors) < 16:
|
for i in range(0, 20, 1):
|
||||||
logging.error("Imagemagick couldn't generate a palette.")
|
raw_colors = imagemagick(16 + i, img, magick_command)
|
||||||
logging.error("Try a different image or backend.")
|
|
||||||
sys.exit(1)
|
if len(raw_colors) > 16:
|
||||||
|
break
|
||||||
|
|
||||||
|
elif i == 19:
|
||||||
|
logging.error("Imagemagick couldn't generate a suitable palette.")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
else:
|
||||||
|
logging.warning("Imagemagick couldn't generate a palette.")
|
||||||
|
logging.warning("Trying a larger palette size %s", 16 + i)
|
||||||
|
|
||||||
return [re.search("#.{6}", str(col)).group(0) for col in raw_colors[1:]]
|
return [re.search("#.{6}", str(col)).group(0) for col in raw_colors[1:]]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user