Class VoronoiPattern

java.lang.Object
com.github.darksoulq.abyssallib.common.color.pattern.VoronoiPattern
All Implemented Interfaces:
ColorProvider

public class VoronoiPattern extends Object implements 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

    Constructors
    Constructor
    Description
    VoronoiPattern(org.bukkit.Color[] palette, int density, double scale)
    Constructs a new VoronoiPattern.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.Color
    get(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, wait

    Methods 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 of Colors 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:
      get in interface ColorProvider
      Parameters:
      pos - The spatial Vector position.
      progress - The interpolation progress (unused).
      Returns:
      A Color from the palette corresponding to the nearest cell.