Compare commits

...

1 Commits

Author SHA1 Message Date
9900c2626a example pic (hopefully) 2022-07-07 21:52:00 -05:00
2 changed files with 31 additions and 25 deletions

View File

@ -15,6 +15,10 @@ 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 +28,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).

View File

@ -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",