How would i go about sorting colors?
I wrote a dumb script that just blindly randomly colorize indexed colors found here ->
auto colorize scriptWhat i want to do now or plan to do
is sort the indexed colors from darkest to lightest based on luminance (found an equation for luminance on the internet somewhere).
then randomly generate the same number of colors (used to colorize with) and then sort these colors based on luminance as well and then loop through the indexed colors darkest to brightest and colorize with my generated random colors.
That way my darkest luminance random color will be used to colorize the darkest indexed color and so on to the brightest one.
I'll probably be working vectors instead of list since i think it's easier to set and get values from a vector.
So if i manually created a vector of say for example 3 colors but will have like 12 elements because 1 for calculation of luminance, R, G, B so 4 for each color..
so how do i sort based on the first element(luminance) of each color ....
so if i had something like (L1,R1,G1,B1,L2,R2,G2,B2,L3,R3,G3,B3)...
how do i sort the vector so that it swaps all the RGB along with L value around values based on the L value)
I guess i could manually hack it and manually do it myself but i was hoping there's something already prebuilt for this maybe?
Thanks in advance.