Class GridPattern

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

public class GridPattern extends Object implements ColorProvider
A procedural color provider that generates a 2D grid pattern on the XZ plane.

This pattern consists of a background color and thin lines that repeat at a set interval.

  • Constructor Summary

    Constructors
    Constructor
    Description
    GridPattern(org.bukkit.Color bg, org.bukkit.Color line, double size, double thickness)
    Constructs a new GridPattern.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.Color
    get(org.bukkit.util.Vector pos, double progress)
    Calculates the grid color for the given position.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface ColorProvider

    filter, get
  • Constructor Details

    • GridPattern

      public GridPattern(org.bukkit.Color bg, org.bukkit.Color line, double size, double thickness)
      Constructs a new GridPattern.
      Parameters:
      bg - The background Color.
      line - The Color of the grid lines.
      size - The spacing between lines.
      thickness - The thickness of the lines.
  • Method Details

    • get

      public org.bukkit.Color get(org.bukkit.util.Vector pos, double progress)
      Calculates the grid color for the given position.
      Specified by:
      get in interface ColorProvider
      Parameters:
      pos - The spatial Vector position.
      progress - The interpolation progress (unused).
      Returns:
      line if the position falls within a line's thickness, otherwise bg.