Class ColorMap.Gradient<T>

Object
ColorMap<T>
Gradient<T>
Type Parameters:
T - type of color object: String or MeshLambertMaterial for GWT and Color for JRE
Direct Known Subclasses:
ColorMap.Gradient1D, ColorMap.Gradient2D
Enclosing class:
ColorMap<T>

public abstract static class ColorMap.Gradient<T> extends ColorMap<T>
Abstract super class for color maps following a gradient.
See Also:
  • Constructor Details

    • Gradient

      public Gradient()
      Constructs a new gradient color map.
  • Method Details

    • interpolateColors

      public void interpolateColors(T[] gradient, Color start, int first, Color end, int last)
      Utility method for creating a smooth gradient ranging from color start to color end in last-first steps. The color gradient is stored in the array gradient from elements first to last (inclusive).
      Parameters:
      gradient - the array for storing the color gradient
      start - the starting color
      first - the index in gradient for the start color
      end - the end color
      last - the index in gradient for the end color
    • interpolateColors

      public void interpolateColors(T[] gradient, Color[] colors)
      Utility method for creating a smooth gradient spanning all colors in the array colors. An equal number of shades are created between two adjacent colors. The color gradient is stored in the array gradient.
      Parameters:
      gradient - the array for storing the color gradient
      colors - the array of colors for the gradient
    • translate

      public T translate(double data)
      Translate the double value data to a color gradient. The type of object returned depends on the implementation.
      Parameters:
      data - the double value to convert to a color
      Returns:
      the color object