Class WaveGradient

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

public class WaveGradient extends Object implements ColorProvider
A color provider that applies a sinusoidal wave modulation to a base color provider.
  • Constructor Summary

    Constructors
    Constructor
    Description
    WaveGradient(ColorProvider base, org.bukkit.util.Vector direction, double wavelength, double speed)
    Constructs a WaveGradient.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.Color
    get(org.bukkit.util.Vector pos, double progress)
    Calculates color based on a sine wave oscillating between 0.0 and 1.0.

    Methods inherited from class Object

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

    Methods inherited from interface ColorProvider

    filter, get
  • Constructor Details

    • WaveGradient

      public WaveGradient(ColorProvider base, org.bukkit.util.Vector direction, double wavelength, double speed)
      Constructs a WaveGradient.
      Parameters:
      base - The ColorProvider to modulate.
      direction - The Vector of propagation.
      wavelength - The spatial frequency.
      speed - The temporal frequency.
  • Method Details

    • get

      public org.bukkit.Color get(org.bukkit.util.Vector pos, double progress)
      Calculates color based on a sine wave oscillating between 0.0 and 1.0.
      Specified by:
      get in interface ColorProvider
      Parameters:
      pos - The spatial Vector position.
      progress - The temporal progress.
      Returns:
      The wave-modulated Color.