Alright, I often find myself wanting to arrange colors next to one another to build gradients of different types: gradient by value, gradients that share a hue, etc.
I had previously been trying to do this by cutting up screenshots in gimp but.. man is that labor intensive.
So, I got the idea to turn on the undocumented 5bpp mode so that all 32 available colors can be toyed with on the screen at the same time (at half horizontal resolution, which works fine for this tool) and make a simple tool that both displays the colors and labels their color indexes (I prefer the -16 through 15 numbering so that's what this tool uses) and makes it easy for me to rearrange the colors vertically in any fashion that I want.
Controls:
up and down moves the selection rectangle between colors, wrapping at top and bottom.
O grabs or lets go of a color.
When a color is "grabbed", moving the (filled) selection rectangle around will rearrange that color amongst its peers.
Labeled indices are staggered so that 8px tall labels can align to 4px tall swatches.
Incidentally, the color arrangement in this cart label is the one that GIMP's grayscale mode informs me is the perfect ordering from darkest to lightest. 😁
This tool can also be helpful for creating short gradients when dealing with only 16 colors at a time.
Either you can choose to only rearrange the positive indices if you only want to consider the "documented" colors,
or you can mix both palettes to create gradients of 16 total colors or less which you can then cajole to all be available onscreen at once with no fuss.



Fun, tweaked the code a bit so the texts are shown in color.
Hid the inner working of 5bpp inside functions : w_... (W for wide).
w_print("hello",64,64,-3) for example.
[Please log in to post a comment]