Interface ShadowColor
- All Superinterfaces:
ARGBLike, ComponentBuilderApplicable, RGBLike, StyleBuilderApplicable
-
Method Summary
Modifier and TypeMethodDescriptiondefault @Range(from=0L,to=255L) intalpha()Get the alpha component of the shadow colour.default StringRepresent this shadow color as a#-prefixed hex string.default @Range(from=0L,to=255L) intblue()Get the blue component of the shadow colour.static @Nullable ShadowColorfromHexString(String hex) Attempt to parse a shadow colour from a#-prefixed hex string.default @Range(from=0L,to=255L) intgreen()Get the green component of the shadow colour.static ShadowColorLinearly interpolates betweenaandbbyt.static ShadowColornone()Return a shadow color that will disable the shadow on a component.default @Range(from=0L,to=255L) intred()Get the red component of the shadow colour.static ShadowColorshadowColor(@Range(from=0L,to=255L) int red, @Range(from=0L,to=255L) int green, @Range(from=0L,to=255L) int blue, @Range(from=0L,to=255L) int alpha) Create a new shadow color from individual red, green, blue, and alpha values.static ShadowColorshadowColor(int argb) Create a new shadow color from the ARGB value packed in an int.static ShadowColorshadowColor(ARGBLike argb) Create a shadow color from an existing ARGB colour.static ShadowColorshadowColor(RGBLike rgb, @Range(from=0L,to=255L) int alpha) Create a shadow color from an existing colour plus an alpha value.default voidstyleApply(Style.Builder style) Applies tostyle.intvalue()The int-packed ARGB value of this shadow colour.Methods inherited from interface StyleBuilderApplicable
componentBuilderApply
-
Method Details
-
lerp
Linearly interpolates betweenaandbbyt.This returns a color blended between color
a, att=0.0, and colorb, att=1.0.- Parameters:
t- the interpolation value, between0.0and1.0(both inclusive)a- the lower bound (t=0.0)b- the upper bound (t=1.0)- Returns:
- the interpolated value, a color between the two input colors
aandb - Since:
- 4.18.0
-
none
Return a shadow color that will disable the shadow on a component.- Returns:
- a disabling shadow color
- Since:
- 4.18.0
-
shadowColor
Create a new shadow color from the ARGB value packed in an int.This int will be in the format
0xAARRGGBB- Parameters:
argb- the int-packed ARGB value- Returns:
- a shadow color
- Since:
- 4.18.0
-
shadowColor
@Contract(pure=true) static ShadowColor shadowColor(@Range(from=0L,to=255L) int red, @Range(from=0L,to=255L) int green, @Range(from=0L,to=255L) int blue, @Range(from=0L,to=255L) int alpha) Create a new shadow color from individual red, green, blue, and alpha values.- Parameters:
red- the red valuegreen- the green valueblue- the blue valuealpha- the alpha- Returns:
- a shadow colour
- Since:
- 4.18.0
-
shadowColor
Create a shadow color from an existing colour plus an alpha value.- Parameters:
rgb- the existing coloralpha- the alpha- Returns:
- a shadow colour
- Since:
- 4.18.0
-
shadowColor
Create a shadow color from an existing ARGB colour.- Parameters:
argb- the existing color- Returns:
- a shadow colour
- Since:
- 4.18.0
-
fromHexString
@Contract(pure=true) static @Nullable ShadowColor fromHexString(@Pattern("#[0-9a-fA-F]{8}") String hex) Attempt to parse a shadow colour from a#-prefixed hex string.This string must be in the format
#RRGGBBAA- Parameters:
hex- the input value- Returns:
- a shadow color if possible, or null if any components are invalid
- Since:
- 4.18.0
-
asHexString
Represent this shadow color as a#-prefixed hex string.This string will be in the format
#RRGGBBAA- Returns:
- the hex string representation of this shadow colour
- Since:
- 4.18.0
-
red
-
green
-
blue
-
alpha
-
value
int value()The int-packed ARGB value of this shadow colour.- Returns:
- the shadow colour value
- Since:
- 4.18.0
-
styleApply
Description copied from interface:StyleBuilderApplicableApplies tostyle.- Specified by:
styleApplyin interfaceStyleBuilderApplicable- Parameters:
style- the style builder
-