Class ColorMap

java.lang.Object
net.nullved.pmweatherapi.util.ColorMap

public class ColorMap extends Object
A builder-based representation of ColorTables. Should hopefully be able to produce identical results.

You can create a new ColorMap builder with ColorMap.Builder.of(Color). Use ColorMap.Builder.addPoint(Color, float) to add a new point to lerp between. Use ColorMap.Builder.override(Color, float) to add a new point to override the color at.
Since:
0.14.15.6
  • Method Details

    • minValue

      public float minValue()
      Gets the smallest value a color is defined for
      Returns:
      The minimum value
      Since:
      0.14.15.6
    • maxValue

      public float maxValue()
      Gets the largest value a color is defined for
      Returns:
      The maximum value
      Since:
      0.14.15.6
    • get

      public Color get(float val)
      Gets the Color for the specific value
      Parameters:
      val - The value to get the Color of
      Returns:
      The Color for the given value
      Since:
      0.14.15.6
    • lerp

      public static Color lerp(float delta, Color c1, Color c2)
      Lerps between two colors
      Parameters:
      delta - The t-value from 0 to 1
      c1 - The first Color
      c2 - The second Color
      Returns:
      A Color lerped between c1 and c2
      Since:
      0.14.15.6