4 ms·
Lovely! I think it would be improved by having a cleverer colour-based sorting algorithm. At the moment, you choose one parameter (H, S or V) to sort by, and t
by gjm11 16y ago
Lovely!
I think it would be improved by having a cleverer colour-based sorting algorithm. At the moment, you choose one parameter (H, S or V) to sort by, and the others have no effect at all, and it looks a bit too random.
Here's one toy example of what I think is a more natural-looking order of colours: http://i.imgur.com/xjh97.png http://i.imgur.com/xjh97.png (I took red<<1, green<<2 and blue, and interleaved their bits). Better still might be to sort by position along a Hilbert-curve traversal of the RGB cube or HSL space or something, but I couldn't work out how to do that in 5 minutes so didn't bother :-).
- derefr 16y ago> Better still might be to sort by position along a Hilbert-curve traversal of the RGB cube or HSL space or something Like this? http://corte.si/posts/code/hilbert/portrait/index.html http://corte.si/posts/code/hilbert/portrait/index.html