Class CheckeredPattern
java.lang.Object
com.github.darksoulq.abyssallib.common.color.pattern.CheckeredPattern
- All Implemented Interfaces:
ColorProvider
A procedural color provider that generates a 3D checkerboard pattern.
The pattern alternates between two colors based on the floor of the coordinates divided by the specified size.
-
Constructor Summary
ConstructorsConstructorDescriptionCheckeredPattern(org.bukkit.Color c1, org.bukkit.Color c2, double size) Constructs a new CheckeredPattern. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.Colorget(org.bukkit.util.Vector pos, double progress) Calculates the color for a specific position in 3D space.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ColorProvider
filter, get
-
Constructor Details
-
CheckeredPattern
public CheckeredPattern(org.bukkit.Color c1, org.bukkit.Color c2, double size) Constructs a new CheckeredPattern.- Parameters:
c1- The firstColor.c2- The secondColor.size- The edge length of each checker square.
-
-
Method Details
-
get
public org.bukkit.Color get(org.bukkit.util.Vector pos, double progress) Calculates the color for a specific position in 3D space.- Specified by:
getin interfaceColorProvider- Parameters:
pos- The spatialVectorposition.progress- The interpolation progress (unused in this pattern).- Returns:
c1if the sum of the parity of the grid coordinates is even, otherwisec2.
-