From bce7f4356d4b0fd8f52814bc6b3f0e097644b608 Mon Sep 17 00:00:00 2001 From: whut Date: Thu, 7 Jul 2022 21:32:08 -0500 Subject: [PATCH] example pic (hopefully) --- README.md | 15 ++++++++++----- acid16.py | 40 ++++++++++++++++++++-------------------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 0cf8507..f7a78a9 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,9 @@ This creates a color scheme with: - An accent color with that same hue but more saturation (hue 0.6, chroma 0.5) - Some shade of gray for the foreground color (hue 0.0, chroma 0.0). In this case it'll be a light gray since the background is dark. +Here's the preview it'd generate: +![Color scheme preview](https://pomf2.lain.la/f/mbnay7gd.png) + ## Prerequisites - Python 3 @@ -24,15 +27,17 @@ This creates a color scheme with: ***Obligatory "options are subject to change" courtesy warning*** + +- `-a author`: Set the author name. +- `-b amount`: Make the hue colors blend with the background's hue. 0.0 (default) means no blending, 1.0 makes them the same exact color. If you'd like to have them be the same hue but with different brightnesses, use a value like 0.999. +- `-c contrast`: Desired contrast ratio between the foreground and background colors. Default is 7. 21 guarantees the highest possible contrast (i.e. the foreground will either be white or black). +- `-e`: Equiluminant mode; uses the same luminance for the hues. This keeps their brightness uniform but can make them harder to tell apart. +- `--hsl`: Treat the background color as being gamma-encoded HSL (i.e. what most people are used to). Wouldn't recommend it, but if it works for you... - `-m mode`: Which generator to use. Current generators: - `base16` (default): Base16 - `xresources`: Xresources terminal colors -- `-n name`, `-a author`: Set the scheme and author name. -- `--hsl`: Treat the background color as being gamma-encoded HSL (i.e. what most people are used to). Wouldn't recommend it, but if it works for you... -- `-e`: Equiluminant mode; uses the same luminance for the hues. This keeps their brightness uniform but can make them harder to tell apart. -- `-b amount`: Make the hue colors blend with the background's hue. 0.0 (default) means no blending, 1.0 makes them the same exact color. If you'd like to have them be the same hue but with different brightnesses, use a value like 0.999. +- `-n name`: Set the scheme name. - `-p`: Generate a preview image demonstrating color contrast and the palette itself. -- `-c contrast`: Desired contrast ratio between the foreground and background colors. Default is 7. 21 guarantees the highest possible contrast (i.e. the foreground will either be white or black). - Base16 options: - `-l`: Don't darken the last color (brown). diff --git a/acid16.py b/acid16.py index f32d6ae..683ad56 100755 --- a/acid16.py +++ b/acid16.py @@ -6,21 +6,6 @@ modes = ["base16","xresources"] RED, YELLOW, GREEN, CYAN, BLUE, MAGENTA = 0, 60, 120, 200, 240, 300 parser = optparse.OptionParser(usage="usage: %prog [options] background accent [foreground]") -parser.add_option("-m", "--mode", - action="store", - dest="mode", - default="base16", - help="what to generate ({})".format(", ".join(modes))) -parser.add_option("-p", "--preview", - action="store_true", - dest="showPreview", - default=False, - help="generate a preview image") -parser.add_option("-n", "--name", - action="store", - dest="name", - default="acid16", - help="scheme name") parser.add_option("-a", "--author", action="store", dest="author", @@ -31,16 +16,31 @@ parser.add_option("-b", "--hue-blend", dest="hueBlend", default=0.0, help="mix ratio between hues and background") -parser.add_option("-e", "--equiluminant", - action="store_true", - dest="equiluminant", - default=0.0, - help="use the same luminance for last hues") parser.add_option("-c", "--contrast", action="store", dest="foreContrast", default=7.0, help="contrast between foreground and background (default 7)") +parser.add_option("-e", "--equiluminant", + action="store_true", + dest="equiluminant", + default=0.0, + help="use the same luminance for last hues") +parser.add_option("-m", "--mode", + action="store", + dest="mode", + default="base16", + help="what to generate ({})".format(", ".join(modes))) +parser.add_option("-n", "--name", + action="store", + dest="name", + default="acid16", + help="scheme name") +parser.add_option("-p", "--preview", + action="store_true", + dest="showPreview", + default=False, + help="generate a preview image") parser.add_option("--hsl", action="store_true", dest="hsl",