Commit Graph

20 Commits

Author SHA1 Message Date
9298d72c17 Split up palettes into multicolor/gradient
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-24 22:30:42 -07:00
0baf1f7688 Palettes are selected by matricizer
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>
2024-05-24 22:18:50 -07:00
6c370237ea Remove yellow-light palette. Doesn't look good.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-24 21:41:39 -07:00
426c9580a7 Update palettes to use HSL coloring
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>
2024-05-24 17:39:33 -07:00
d5bd09072a Fix a few things in __main__.py
* 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>
2024-05-24 17:37:46 -07:00
1277c2db8b Add input-type
Input can now either be a path, raw data, or a hash itself (path is
default)

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-24 11:45:42 -07:00
e14c796888 Split out color palettes to their own file
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-24 11:45:23 -07:00
909306cd0c Remove old .svgs from the examples
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-23 11:17:03 -07:00
660a0cb60c Add .pylintrc and some documentation + fixes to shut pylint up.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-22 12:05:20 -07:00
840e878748 Fix types for mypy
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-22 11:15:43 -07:00
2cc9ea319b Add dummy __init__.py for package use
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-22 11:08:02 -07:00
b353b8ff8c Clean up progname in help dialogue
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-22 11:01:54 -07:00
ed892b7630 Add all examples
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-22 10:58:39 -07:00
4a9225d27f Add a tool that will generate examples using all matrix and hash options
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>
2024-05-22 10:57:36 -07:00
962d2ad316 Add command line parsing
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-22 10:45:41 -07:00
f2627f5096 Rename hash_to_matrix to matricize
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-21 18:26:17 -07:00
f70e5a4222 Split functionality out into matrix and color passes
* Matricizers turn a hash into a matrix
* Colorizers turn a matrix into a colored matrix

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-21 18:23:14 -07:00
6fef09d602 OOP-ify this sucker
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>
2024-05-21 12:47:50 -07:00
4d56302e1c Add a couple of examples
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-21 12:09:21 -07:00
adbdf85b0e initial commit
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-21 11:54:15 -07:00