Class BilinearGradient
java.lang.Object
com.github.darksoulq.abyssallib.common.color.gradient.BilinearGradient
- All Implemented Interfaces:
ColorProvider
A color provider that performs bilinear interpolation between four corner colors on a 2D plane.
-
Constructor Summary
ConstructorsConstructorDescriptionBilinearGradient(org.bukkit.Color c00, org.bukkit.Color c10, org.bukkit.Color c01, org.bukkit.Color c11, double scaleX, double scaleZ) Constructs a BilinearGradient. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.Colorget(org.bukkit.util.Vector pos, double progress) Maps the spatial position to a normalized 2D coordinate system and performs bilinear interpolation.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ColorProvider
filter, get
-
Constructor Details
-
BilinearGradient
public BilinearGradient(org.bukkit.Color c00, org.bukkit.Color c10, org.bukkit.Color c01, org.bukkit.Color c11, double scaleX, double scaleZ) Constructs a BilinearGradient.- Parameters:
c00- Color at (0, 0).c10- Color at (1, 0).c01- Color at (0, 1).c11- Color at (1, 1).scaleX- The width of the gradient unit.scaleZ- The length of the gradient unit.
-
-
Method Details
-
get
public org.bukkit.Color get(org.bukkit.util.Vector pos, double progress) Maps the spatial position to a normalized 2D coordinate system and performs bilinear interpolation.- Specified by:
getin interfaceColorProvider- Parameters:
pos- The spatialVectorposition.progress- The interpolation progress (unused).- Returns:
- The interpolated
Color.
-