Class ColorMapCSS.Gradient1D

Enclosing class:
ColorMapCSS

public static class ColorMapCSS.Gradient1D extends ColorMap.Gradient1D<String>
One dimensional color gradient spanning two or more colors
  • Constructor Details

    • Gradient1D

      public Gradient1D(Color start, Color end, int nIncr)
      Construct color gradient ranging from color start to color end and interpolate with steps-1 intermediate colors. The resulting gradient spans steps+1 colors. The default range for mapping data values onto the color gradient is [0.0, 1.0].
      Parameters:
      start - the starting color
      end - the ending color
      nIncr - the number of intermediate colors
      See Also:
    • Gradient1D

      public Gradient1D(Color start, Color end, int trait, int nIncr)
      Construct color gradient ranging from color start to color end and interpolate with steps-1 intermediate colors. The resulting gradient spans steps+1 colors. The default range for mapping data values onto the color gradient is [0.0, 1.0].
      Parameters:
      start - the starting color
      end - the ending color
      trait - the index of the trait
      nIncr - the number of intermediate colors
      See Also:
    • Gradient1D

      public Gradient1D(Color[] colors, int nIncr)
      Construct color gradient running through all the colors in the array colors. The number of interpolated intermediate colors between two subsequent entries in colors is (steps-1)/(N-1), where N is the number of colors in colors. The resulting gradient spans steps+1 colors. The default range for mapping data values onto the color gradient is [0.0, 1.0].
      Parameters:
      colors - the equally spaced reference colors of the gradient
      nIncr - the number of intermediate, gradient colors
      See Also:
    • Gradient1D

      public Gradient1D(Color[] colors, int trait, int nIncr)
      Construct color gradient running through all the colors in the array colors. The number of interpolated intermediate colors between two subsequent entries in colors is (steps-1)/(N-1), where N is the number of colors in colors. The resulting gradient spans steps+1 colors. The default range for mapping data values onto the color gradient is [0.0, 1.0].
      Parameters:
      colors - the equally spaced reference colors of the gradient
      trait - the index of the trait
      nIncr - the number of intermediate, gradient colors
      See Also:
  • Method Details

    • color2Color

      public String color2Color(Color color)
      Description copied from class: ColorMap
      Utility method to convert the color into a color object of type T.
      Specified by:
      color2Color in class ColorMap<String>
      Parameters:
      color - the color to convert
      Returns:
      the color represented as an object of type T