Class VoronoiPattern
java.lang.Object
com.github.darksoulq.abyssallib.common.color.pattern.VoronoiPattern
- All Implemented Interfaces:
ColorProvider
A procedural color provider that generates a Voronoi (cellular) diagram on the XZ plane.
The space is divided into cells based on the nearest seed point, where each cell is assigned a color from the provided palette.
-
Constructor Summary
ConstructorsConstructorDescriptionVoronoiPattern(org.bukkit.Color[] palette, int density, double scale) Constructs a new VoronoiPattern. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.Colorget(org.bukkit.util.Vector pos, double progress) Calculates the color of the cell belonging to the closest seed point.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ColorProvider
filter, get
-
Constructor Details
-
VoronoiPattern
public VoronoiPattern(org.bukkit.Color[] palette, int density, double scale) Constructs a new VoronoiPattern.- Parameters:
palette- The array ofColors to use.density- The number of seed points to generate.scale- The bounding scale for the generated points.
-
-
Method Details
-
get
public org.bukkit.Color get(org.bukkit.util.Vector pos, double progress) Calculates the color of the cell belonging to the closest seed point.- Specified by:
getin interfaceColorProvider- Parameters:
pos- The spatialVectorposition.progress- The interpolation progress (unused).- Returns:
- A
Colorfrom the palette corresponding to the nearest cell.
-