mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-06-19 08:06:38 +02:00
general: Add palette to output.
This commit is contained in:
parent
9c8ea3e45e
commit
dc8ca8af27
@ -158,6 +158,7 @@ def process_args(args):
|
|||||||
wallpaper.change(colors_plain["wallpaper"])
|
wallpaper.change(colors_plain["wallpaper"])
|
||||||
|
|
||||||
sequences.send(colors_plain, to_send=not args.s)
|
sequences.send(colors_plain, to_send=not args.s)
|
||||||
|
colors.palette()
|
||||||
export.every(colors_plain)
|
export.every(colors_plain)
|
||||||
|
|
||||||
if not args.e:
|
if not args.e:
|
||||||
|
@ -89,6 +89,24 @@ def get_backend(backend):
|
|||||||
random.shuffle(backends)
|
random.shuffle(backends)
|
||||||
return backends[0]
|
return backends[0]
|
||||||
|
|
||||||
|
return backend
|
||||||
|
|
||||||
|
|
||||||
|
def palette():
|
||||||
|
"""Generate a palette from the colors."""
|
||||||
|
col_width = " " * (os.get_terminal_size().columns // 8)
|
||||||
|
|
||||||
|
for i in range(0, 16):
|
||||||
|
if i % 8 == 0:
|
||||||
|
print()
|
||||||
|
|
||||||
|
if i > 7:
|
||||||
|
i = "8;5;%s" % i
|
||||||
|
|
||||||
|
print("\033[4%sm%s\033[0m" % (i, col_width), end="")
|
||||||
|
|
||||||
|
print("\n")
|
||||||
|
|
||||||
|
|
||||||
def get(img, light=False, backend="wal", cache_dir=CACHE_DIR):
|
def get(img, light=False, backend="wal", cache_dir=CACHE_DIR):
|
||||||
"""Generate a palette."""
|
"""Generate a palette."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user