Package ch.swingfx.color
Class ColorUtil
- java.lang.Object
-
- ch.swingfx.color.ColorUtil
-
public final class ColorUtil extends java.lang.ObjectUtility for working with colors
-
-
Constructor Summary
Constructors Modifier Constructor Description privateColorUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intfloatAlphaToIntAlpha(float alpha)Converts a float value between 0f and 1f to an int value between 0 and 255static java.awt.ColorwithAlpha(java.awt.Color color, float alpha)Creates a newColorwith RGB fromcolorand the alpha value ofalpha
-
-
-
Method Detail
-
withAlpha
public static java.awt.Color withAlpha(java.awt.Color color, float alpha)Creates a newColorwith RGB fromcolorand the alpha value ofalpha- Parameters:
color-Coloryou want to have withalphaalpha- alpha value you want to set. Must be between 0f and 1f- Returns:
- new
Colorwithalpha
-
floatAlphaToIntAlpha
public static int floatAlphaToIntAlpha(float alpha)
Converts a float value between 0f and 1f to an int value between 0 and 255- Parameters:
alpha- value between 0f and 1f- Returns:
- int value between 0 and 255
-
-