Class BilinearGradient

java.lang.Object
com.github.darksoulq.abyssallib.common.color.gradient.BilinearGradient
All Implemented Interfaces:
ColorProvider

public class BilinearGradient extends Object implements ColorProvider
A color provider that performs bilinear interpolation between four corner colors on a 2D plane.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BilinearGradient(org.bukkit.Color c00, org.bukkit.Color c10, org.bukkit.Color c01, org.bukkit.Color c11, double scaleX, double scaleZ)
    Constructs a BilinearGradient.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.Color
    get(org.bukkit.util.Vector pos, double progress)
    Maps the spatial position to a normalized 2D coordinate system and performs bilinear interpolation.

    Methods inherited from class Object

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

    Methods inherited from interface ColorProvider

    filter, get
  • Constructor Details

    • BilinearGradient

      public BilinearGradient(org.bukkit.Color c00, org.bukkit.Color c10, org.bukkit.Color c01, org.bukkit.Color c11, double scaleX, double scaleZ)
      Constructs a BilinearGradient.
      Parameters:
      c00 - Color at (0, 0).
      c10 - Color at (1, 0).
      c01 - Color at (0, 1).
      c11 - Color at (1, 1).
      scaleX - The width of the gradient unit.
      scaleZ - The length of the gradient unit.
  • Method Details

    • get

      public org.bukkit.Color get(org.bukkit.util.Vector pos, double progress)
      Maps the spatial position to a normalized 2D coordinate system and performs bilinear interpolation.
      Specified by:
      get in interface ColorProvider
      Parameters:
      pos - The spatial Vector position.
      progress - The interpolation progress (unused).
      Returns:
      The interpolated Color.