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 TypeMethodDescriptionaddPoint(int color, float threshold) Adds a point to lerp between.static ColorMap.Builderbiome()Creates a newColorMap.Builderthat has a defaultColor.BLACKbase.build(int finalColor, float finalThreshold) Builds thisColorMap.Builderinto a properColorMaplookupResolution(float resolution) Sets the step size between each value in the lookup table.static ColorMap.Builderof(int base) Creates a newColorMap.Builderwith the givenColoras the baseoverride(int color, float threshold) Adds 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
-
biome
Creates a newColorMap.Builderthat has a defaultColor.BLACKbase. This method has no effect unless you useColorMap.getWithBiome(float, Holder, double, double)- Returns:
- The created
ColorMap.Builder - Since:
- 0.15.0.0
-
lookupResolution
Sets the step size between each value in the lookup table. A value too small may be storing the same color multiple times!- Parameters:
resolution- The resolution of the lookup table. Default 0.1F- Returns:
- This
ColorMap.Builder - Since:
- 0.14.16.1
-
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
-