/***** * * @author S. Tanimoto * This class offers a method for returning colors in a "progressive" sequence. * The colors at the beginning of the sequence contrast highly with each other, and later colors fill in other parts of the color space. * To use this, create an instance pc of ProgressiveColors, and then call the method: pc.progressiveColor(k). * For example, if k=0, then the color is [0, 0, 0] (black). * If k=1, the color is [255,255,255] (white). * If k=2, the color is [255,0,0] (red). * * created Nov. 5, 2014. */ public class ProgressiveColors { static int NBITS = 24; // Size of the full color space, in bits per pixel. // Mapping used in procedure map3bits. static int[][] triples = { {0,0,0}, {1,1,1},{1,0,0},{0,1,1},{1,1,0},{0,0,1},{0,1,0},{1,0,1}}; // A trivial constructor: public ProgressiveColors() { } int[] reverseBits(int k) { int[] bits = new int[24]; int quotient = k; for(int i=0; i