I made this simple tool for generating tables for fading colors with pal(). It generates the table and a simple function for setting up.
In the future, I will experiment with stuff like non-linear interpolation and separate speeds for R, G and B.
In LAB space a standard Euclidean distance metric works pretty well to match/differentiate hues. (Might be overkill for this but just curious if it leads to different results.)
Some simple token-saving optimizations :
The last column in the table is always redundant. You can save tokens by deleting the last value from each row of the table, and editing the line "if i+1>=N" (change N to N-1)
If you're fading to black, you can delete the first row of the table. Loop over c=1,15, and change "[c+1]" to "[c]"
(If you were fading to color 15, you could easily delete the last row, but who fades to color 15?)
Shouldn't this be pinned in resources? Seems extremely useful. I'd even see if there would be a way to move the offsite tool to lexoffle.com itself, or maybe port the interpolation scheme into a cart so you can write it and the code to the clipboard.
Also, any plans to update this to include the new 16 colors found? I bet they'd make really nice super smooth transitions.
[Please log in to post a comment]