This will just do a `cat` of all Python files in the colorhash/
directory and shove it into a fullsource.in file.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
ANSI-based color output is available and now the default. Add a
-y / --output-type argument to select SVG or ANSI output. Also update
tools/genexamples.sh to use the SVG output type.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
Generally, palettes are expressed using HSL, but sometimes we want the
output to be in RGB (or some other format). Colors are now expressed
using either RGBColor or HSLColor and can easily be converted between
the two.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
CLI implementation will now live in colorhash/cli.py, and __main__ will
just import and call the cli_main() function.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
Matricizers select color palettes now. This is motivated by the fact
that the gradient palettes don't really look good for openssh randomart
based art, and rainbows do look good.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
Introduce a new function called `hsl_colors` and a helper `quantize`
function that creates palettes using HSL values on the fly. Default
palettes are now split into "<colorname>-dark" and "<colorname>-light"
for more variation.
In my experiments, red-centric colors seem to be more distinguishable
than others. You have red, green, blue - you can tell they're distinct.
Interleaved between these you have yellow, cyan, and magenta, also
distinct. But between yellow and green, or green and cyan, these colors
feel less distinct than orange, purple or pink. I have opted to elide
non-red "in-betweens" such as those. So we have a dark and light variant
of the following colors as palettes:
red, orange, yellow, green, cyan, blue, purple, magenta, pink, gray, and
also a rainbow palette that is every color at its full saturation.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* Palette choices are determined by the list of palettes available and
not hard-coded
* Auto palette is chosen by the length of the palette choices rather
than hard-coded
* Palette help listing is text-wrapped at 70 characters
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This tool will go through the examples directory and generate an image
for all *.in files using every hash and matrix option.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
Colorization can be done using a class now. This allows for more
pluggable coloring methods and lets me try out new things easier.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>