Package com.formdev.flatlaf.util
Class ColorFunctions
- java.lang.Object
-
- com.formdev.flatlaf.util.ColorFunctions
-
public class ColorFunctions extends java.lang.ObjectFunctions that modify colors.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceColorFunctions.ColorFunctionstatic classColorFunctions.FadeSet the alpha of a color.static classColorFunctions.HSLIncreaseDecreaseIncrease or decrease hue, saturation, luminance or alpha of a color in the HSL color space by an absolute or relative amount.
-
Constructor Summary
Constructors Constructor Description ColorFunctions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.awt.ColorapplyFunctions(java.awt.Color color, ColorFunctions.ColorFunction... functions)static floatclamp(float value)static java.awt.Colormix(java.awt.Color color1, java.awt.Color color2, float weight)Returns a color that is a mixture of two colors.
-
-
-
Method Detail
-
applyFunctions
public static java.awt.Color applyFunctions(java.awt.Color color, ColorFunctions.ColorFunction... functions)
-
clamp
public static float clamp(float value)
-
mix
public static java.awt.Color mix(java.awt.Color color1, java.awt.Color color2, float weight)Returns a color that is a mixture of two colors.- Parameters:
color1- first colorcolor2- second colorweight- the weight (in range 0-1) to mix the two colors. Larger weight uses more of first color, smaller weight more of second color.- Returns:
- mixture of colors
-
-