Package net.nullved.pmweatherapi.util
Class ColorMap.Builder
java.lang.Object
net.nullved.pmweatherapi.util.ColorMap.Builder
- Enclosing class:
ColorMap
A Builder pattern for creating a
ColorMap- Since:
- 0.14.15.6
-
Method Summary
Modifier and TypeMethodDescriptionAdds a point to lerp between.Builds thisColorMap.Builderinto a properColorMapstatic ColorMap.BuilderCreates a newColorMap.Builderwith the givenColoras the baseAdds an override point.Use in cases where you want overrides to only apply when the value is greater, but not equal to the threshold.
-
Method Details
-
of
Creates a newColorMap.Builderwith the givenColoras the base- Parameters:
base- The baseColor- Returns:
- The created
ColorMap.Builder - Since:
- 0.14.15.6
-
overrideModeGreater
Use in cases where you want overrides to only apply when the value is greater, but not equal to the threshold. Used inColorMaps.POSITIVE_VELOCITYandColorMaps.NEGATIVE_VELOCITY- Returns:
- This
ColorMap.Builder - Since:
- 0.14.15.6
-
addPoint
Adds a point to lerp between.- Parameters:
color- The color at the end of the lastColorMap.LerpSegmentand the start of thisColorMap.LerpSegmentthreshold- The threshold value- Returns:
- This
ColorMap.Builder - Since:
- 0.14.15.6
-
override
Adds an override point. The finalColorwill get overwritten once it reaches the threshold value specified- Parameters:
color- TheColorto override the finalColorwiththreshold- The threshold value- Returns:
- This
ColorMap.Builder - Since:
- 0.14.15.6
-
build
Builds thisColorMap.Builderinto a properColorMap
-