args: -c now exits, colors: simplified colorz

This commit is contained in:
Dylan Araps 2018-06-21 13:46:45 +10:00
parent bbd1bd3558
commit f29164baf9
2 changed files with 6 additions and 7 deletions

View File

@ -116,6 +116,11 @@ def parse_args_exit(parser):
reload.colors()
sys.exit(0)
if args.c:
scheme_dir = os.path.join(CACHE_DIR, "schemes")
shutil.rmtree(scheme_dir, ignore_errors=True)
sys.exit(0)
if not args.i and \
not args.theme and \
not args.R and \
@ -141,10 +146,6 @@ def parse_args(parser):
logging.getLogger().disabled = True
sys.stdout = sys.stderr = open(os.devnull, "w")
if args.c:
scheme_dir = os.path.join(CACHE_DIR, "schemes")
shutil.rmtree(scheme_dir, ignore_errors=True)
if args.a:
util.Color.alpha_num = args.a

View File

@ -24,9 +24,7 @@ def gen_colors(img):
def adjust(cols, light):
"""Create palette."""
bg = util.blend_color("#555555", cols[1])
raw_colors = [bg, *cols, "#FFFFFF",
raw_colors = [cols[0], *cols, "#FFFFFF",
"#333333", *cols, "#FFFFFF"]
return colors.generic_adjust(raw_colors, light)