// All colours with integer J.a.b. values function constraint({J, a, b}) { return true; } // Constant distance to a given colour: function constraint({J, a, b}) { var centre = d3.jab(120, 20, 20); // J, a, b var dist = jab_dist(centre, d3.jab(J, a, b)); return (75 < dist && dist < 76); } // other functions.. return 30*30 < a*a+b*b ; // No greys return a + b < 10; // no red return J < 30; // dark return 80 < J; // light return jab_dist(d3.jab(J, a, b), d3.jab("blue")) < 50; // blues return jab_dist(d3.jab(J, a, b), d3.jab("red")) < 50; // reds return jab_dist(d3.jab(J, a, b), d3.jab("#00ff00")) > 70; // no greens return rgb().r > 230; // Strong red channel
Click Start to generate a continuous sequence of distinct colours for diagrams.
You can alter the "constraint" function to filter colours before the selection process starts.
Sampling is done in the CIECAM02-UCS color space so that perceptually different colours are equally spaced. The sampler always chooses the next colour to be as far as possible from all the previously sampled colours.
Bibliography: