com.metsci.glimpse.support.colormap
Class ColorGenerator

java.lang.Object
  extended by com.metsci.glimpse.support.colormap.ColorGenerator

public class ColorGenerator
extends java.lang.Object

Picks colors from a given ColorGradient. This is especially useful when trying to get visually distinct colors and the number of colors is not known a-priori.

The current implementation indexes into the ColorGradient using the following sequence (and allows for a max of ~1000 colors before wrapping):

 0, 1, 0.5, 0.25, 0.75, 0.125, 0.375, 0.625, 0.875, 0.0625, ...
 

Author:
borkholder

Constructor Summary
ColorGenerator()
          Creates a new ColorGenerator using the jet color gradient.
ColorGenerator(ColorGradient colors)
          Creates a new ColorGenerator using the given ColorGradient.
 
Method Summary
 void next(float[] rgba)
          Gets the next color in the series.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorGenerator

public ColorGenerator()
Creates a new ColorGenerator using the jet color gradient.


ColorGenerator

public ColorGenerator(ColorGradient colors)
Creates a new ColorGenerator using the given ColorGradient.

Method Detail

next

public void next(float[] rgba)
Gets the next color in the series. At some point, this will wrap and restart with the first color in the sequence.



Copyright © 2012 Metron, Inc.. All Rights Reserved.