Tag Info

Hot answers tagged

23

If you're looking for a way to sort the colors in such a way as to make them seem the least discontinuous, then one way to think of it is that each color is a point in a space endowed with a distance metric (either the CIELAB 1976 or the CIELAB2000 perceptual metrics), and you are trying to find a shortest tour that visits each point. We can do that with ...


6

Just for fun, how does a 3D Hilbert curve sample the 3D colourspace of RGB? and can it be used to sort colours? HilbertCurve3D[n] generates a 3D Hilbert curve of order n. The code is by Michael Trott from page 93 of The Mathematica Guidebook for Programming. HilbertCurve3D[n_Integer?Positive] := Module[{axiom = "X", recursion = "X" -> {"t", "c", "X", ...


3

I've decided to follow through on my suggestion in a comment to Kenny's answer to use Morton ordering (a.k.a. Z-ordering) of the colors in RGB space. Here's a short routine to generate the n-th iterate of a d-dimensional Z-curve: Morton[d_Integer, n_Integer] := Array[FromDigits[BitGet[#1, d Range[n - 1, 0, -1] + #2], 2] &, {2^(n d), d}, {0, ...



Only top voted, non community-wiki answers of a minimum length are eligible