Package com.marcusslover.plus.lib.color
Class ColorGradient
java.lang.Object
com.marcusslover.plus.lib.color.ColorGradient
Represents a class that can be used to create a color gradient.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull Colorat(float percentage) Gets the color at the specified percentage.@NotNull ColorGradientIterates over the gradient.@NotNull ColorGradientreverse()Reverses the gradient.
-
Constructor Details
-
ColorGradient
public ColorGradient()
-
-
Method Details
-
at
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 number of times to iterateconsumer- the consumer- Returns:
- the gradient
-
reverse
Reverses the gradient.- Returns:
- the reversed gradient
-