Package com.formdev.flatlaf.util
Class ColorFunctions
- java.lang.Object
-
- com.formdev.flatlaf.util.ColorFunctions
-
public class ColorFunctions extends Object
Functions 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.HSLChangeSet the hue, saturation, luminance or 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.static classColorFunctions.MixMix two colors.
-
Constructor Summary
Constructors Constructor Description ColorFunctions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ColorapplyFunctions(Color color, ColorFunctions.ColorFunction... functions)static floatclamp(float value)static Colormix(Color color1, Color color2, float weight)Returns a color that is a mixture of two colors.
-
-
-
Method Detail
-
applyFunctions
public static Color applyFunctions(Color color, ColorFunctions.ColorFunction... functions)
-
clamp
public static float clamp(float value)
-
mix
public static Color mix(Color color1, 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
-
-