Interface ColorProvider

All Known Implementing Classes:
AbstractGradient, BilinearGradient, CheckeredPattern, GridPattern, LinearGradient, NoiseGradient, RadialGradient, StripedPattern, SweepGradient, VoronoiPattern, WaveGradient
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ColorProvider
A functional interface representing a procedural color source.

A ColorProvider determines a Color based on a 3D spatial position and a temporal progress value. It serves as the base for all gradients, procedural patterns, and dynamic color animations.

  • Method Summary

    Modifier and Type
    Method
    Description
    bilinear(org.bukkit.Color c00, org.bukkit.Color c10, org.bukkit.Color c01, org.bukkit.Color c11, double scaleX, double scaleZ)
    Creates a bilinear gradient provider for 2D surface interpolation.
    checkered(org.bukkit.Color c1, org.bukkit.Color c2, double size)
    Creates a 3D checkerboard pattern.
    Wraps this provider with a ColorFilter.
    fixed(org.bukkit.Color color)
    Creates a provider that always returns the same static color.
    default org.bukkit.Color
    get(double progress)
    Samples a color based purely on progress, using a default vector.
    org.bukkit.Color
    get(org.bukkit.util.Vector position, double progress)
    Samples a color at the specified 3D position and animation progress.
    grid(org.bukkit.Color bg, org.bukkit.Color line, double size, double thickness)
    Creates a grid pattern.
    linear(List<org.bukkit.Color> colors)
    Creates a linear gradient provider from a list.
    linear(org.bukkit.Color... colors)
    Creates a linear gradient provider.
    noise(ColorProvider base, double freq)
    Wraps a provider with Perlin noise to create organic, smoky transitions.
    radial(double radius, org.bukkit.Color... colors)
    Creates a radial gradient provider originating from the center.
    Creates a dynamic rainbow provider that cycles through hues over the progress value.
    striped(org.bukkit.Color c1, org.bukkit.Color c2, double width, org.bukkit.util.Vector dir)
    Creates a striped pattern along a specific direction.
    sweep(org.bukkit.Color... colors)
    Creates a sweep gradient provider that rotates around the center.
    voronoi(org.bukkit.Color[] palette, int density, double scale)
    Creates a cellular Voronoi pattern.
    wave(ColorProvider base, org.bukkit.util.Vector dir, double waveLength, double speed)
    Modulates a provider with a sine wave based on position and time.
  • Method Details

    • get

      org.bukkit.Color get(org.bukkit.util.Vector position, double progress)
      Samples a color at the specified 3D position and animation progress.
      Parameters:
      position - The spatial Vector representing where to sample the color.
      progress - A normalized value (usually 0.0 to 1.0) representing time or completion.
      Returns:
      The resulting Color.
    • get

      default org.bukkit.Color get(double progress)
      Samples a color based purely on progress, using a default vector.
      Parameters:
      progress - The normalized progress value.
      Returns:
      The resulting Color.
    • filter

      default ColorProvider filter(ColorFilter filter)
      Wraps this provider with a ColorFilter.
      Parameters:
      filter - The filter to apply to the output of this provider.
      Returns:
      A new ColorProvider that returns filtered colors.
    • fixed

      static ColorProvider fixed(org.bukkit.Color color)
      Creates a provider that always returns the same static color.
      Parameters:
      color - The Color to return.
      Returns:
      A fixed color provider.
    • rainbow

      static ColorProvider rainbow()
      Creates a dynamic rainbow provider that cycles through hues over the progress value.
      Returns:
      A rainbow ColorProvider.
    • linear

      static ColorProvider linear(org.bukkit.Color... colors)
      Creates a linear gradient provider.
      Parameters:
      colors - The color stops for the gradient.
      Returns:
      A LinearGradient instance.
    • linear

      static ColorProvider linear(List<org.bukkit.Color> colors)
      Creates a linear gradient provider from a list.
      Parameters:
      colors - The list of color stops.
      Returns:
      A LinearGradient instance.
    • radial

      static ColorProvider radial(double radius, org.bukkit.Color... colors)
      Creates a radial gradient provider originating from the center.
      Parameters:
      radius - The radius at which the gradient completes.
      colors - The color stops for the gradient.
      Returns:
      A RadialGradient instance.
    • sweep

      static ColorProvider sweep(org.bukkit.Color... colors)
      Creates a sweep gradient provider that rotates around the center.
      Parameters:
      colors - The color stops for the gradient.
      Returns:
      A SweepGradient instance.
    • bilinear

      static ColorProvider bilinear(org.bukkit.Color c00, org.bukkit.Color c10, org.bukkit.Color c01, org.bukkit.Color c11, double scaleX, double scaleZ)
      Creates a bilinear gradient provider for 2D surface interpolation.
      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 cycle.
      scaleZ - The depth of the gradient cycle.
      Returns:
      A BilinearGradient instance.
    • noise

      static ColorProvider noise(ColorProvider base, double freq)
      Wraps a provider with Perlin noise to create organic, smoky transitions.
      Parameters:
      base - The base provider to sample from.
      freq - The frequency of the noise.
      Returns:
      A NoiseGradient instance.
    • wave

      static ColorProvider wave(ColorProvider base, org.bukkit.util.Vector dir, double waveLength, double speed)
      Modulates a provider with a sine wave based on position and time.
      Parameters:
      base - The base provider.
      dir - The direction of the wave propagation.
      waveLength - The distance between wave peaks.
      speed - The rate of wave movement.
      Returns:
      A WaveGradient instance.
    • checkered

      static ColorProvider checkered(org.bukkit.Color c1, org.bukkit.Color c2, double size)
      Creates a 3D checkerboard pattern.
      Parameters:
      c1 - The first color.
      c2 - The second color.
      size - The size of each square.
      Returns:
      A CheckeredPattern instance.
    • striped

      static ColorProvider striped(org.bukkit.Color c1, org.bukkit.Color c2, double width, org.bukkit.util.Vector dir)
      Creates a striped pattern along a specific direction.
      Parameters:
      c1 - The first stripe color.
      c2 - The second stripe color.
      width - The width of the stripes.
      dir - The direction of the stripes.
      Returns:
      A StripedPattern instance.
    • grid

      static ColorProvider grid(org.bukkit.Color bg, org.bukkit.Color line, double size, double thickness)
      Creates a grid pattern.
      Parameters:
      bg - The background color.
      line - The color of the grid lines.
      size - The spacing between lines.
      thickness - The thickness of the lines.
      Returns:
      A GridPattern instance.
    • voronoi

      static ColorProvider voronoi(org.bukkit.Color[] palette, int density, double scale)
      Creates a cellular Voronoi pattern.
      Parameters:
      palette - The colors available for cells.
      density - The number of seed points.
      scale - The coordinate scale.
      Returns:
      A VoronoiPattern instance.