public final class TranslucencyHelper extends Object
Modifier and Type | Method and Description |
---|---|
static float |
alphaToTranslucency(int alpha)
Converts an alpha value to a translucency value.
|
static Color |
createColorFromColorAndTranslucency(Color color,
float translucency)
Creates a color from a given color and a given translucency.
|
static float |
extractTranslucencyFromColor(Color color)
Extracts a translucency value from the alpha channel of a color.
|
static int |
translucencyToAlpha(float translucency)
Converts a translucency value to an alpha value.
|
public static float alphaToTranslucency(int alpha)
alpha
- The alpha value to convert to a translucency.public static int translucencyToAlpha(float translucency)
translucency
- The translucency value to convert to an alpha.public static float extractTranslucencyFromColor(@Nonnull Color color)
TranslucencyHelper.alphaToTranslucency(int)
on the alpha component of the color.color
- The color from which to extra translucency.@Nonnull public static Color createColorFromColorAndTranslucency(@Nonnull Color color, float translucency)
TranslucencyHelper.translucencyToAlpha(float)
on the provided translucency
value.color
- The base color.translucency
- The translucency value.