Class CheckeredPattern

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

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

    Constructors
    Constructor
    Description
    CheckeredPattern(org.bukkit.Color c1, org.bukkit.Color c2, double size)
    Constructs a new CheckeredPattern.
  • Method Summary

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

    Methods 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 first Color.
      c2 - The second Color.
      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:
      get in interface ColorProvider
      Parameters:
      pos - The spatial Vector position.
      progress - The interpolation progress (unused in this pattern).
      Returns:
      c1 if the sum of the parity of the grid coordinates is even, otherwise c2.