2 Generate a colorscheme using Haishoku.
8 from haishoku.haishoku import Haishoku
11 logging.error("Haishoku wasn't found on your system.")
12 logging.error("Try another backend. (wal --backend)")
20 """Generate a colorscheme using Colorz."""
21 palette = Haishoku.getPalette(img)
22 return [util.rgb_to_hex(col[1]) for col in palette]
25 def adjust(cols, light):
27 cols.sort(key=util.rgb_to_yiq)
28 raw_colors = [*cols, *cols]
29 raw_colors[0] = util.lighten_color(cols[0], 0.40)
31 return colors.generic_adjust(raw_colors, light)
34 def get(img, light=False):
35 """Get colorscheme."""
36 cols = gen_colors(img)
37 return adjust(cols, light)