Class ColorGradient

java.lang.Object
com.marcusslover.plus.lib.color.ColorGradient

public class ColorGradient extends Object
Represents a class that can be used to create a color gradient.
  • Constructor Details

    • ColorGradient

      public ColorGradient()
  • Method Details

    • at

      @NotNull public @NotNull Color at(float percentage)
      Gets the color at the specified percentage.
      Parameters:
      percentage - the percentage, between 0 and 1
      Returns:
      the color
    • forEach

      @NotNull public @NotNull ColorGradient forEach(int amount, @NotNull @NotNull Consumer<Color> consumer)
      Iterates over the gradient.
      Parameters:
      amount - the amount of times to iterate
      consumer - the consumer
      Returns:
      the gradient
    • reverse

      @NotNull public @NotNull ColorGradient reverse()
      Reverses the gradient.
      Returns:
      the reversed gradient