Package net.kyori.adventure.text.format
Interface ShadowColor
- All Superinterfaces:
ARGBLike,ComponentBuilderApplicable,RGBLike,StyleBuilderApplicable
A shadow color which may be applied to a
Style.
Similar to TextColor, except that shadows contain alpha information.
- Since:
- 4.18.0
- Since Minecraft:
- 1.21.4
-
Method Summary
Modifier and TypeMethodDescriptiondefault @org.jetbrains.annotations.Range(from=0L, to=255L) intalpha()Get the alpha component of the shadow colour.default @NotNull StringRepresent this shadow color as a#-prefixed hex string.default @org.jetbrains.annotations.Range(from=0L, to=255L) intblue()Get the blue component of the shadow colour.static @Nullable ShadowColorfromHexString(@NotNull String value) Attempt to parse a shadow colour from a#-prefixed hex string.default @org.jetbrains.annotations.Range(from=0L, to=255L) intgreen()Get the green component of the shadow colour.static @NotNull ShadowColornone()Return a shadow colour that will disable the shadow on a component.default @org.jetbrains.annotations.Range(from=0L, to=255L) intred()Get the red component of the shadow colour.static @NotNull ShadowColorshadowColor(@org.jetbrains.annotations.Range(from=0L, to=255L) int red, @org.jetbrains.annotations.Range(from=0L, to=255L) int green, @org.jetbrains.annotations.Range(from=0L, to=255L) int blue, @org.jetbrains.annotations.Range(from=0L, to=255L) int alpha) Create a new shadow color from individual red, green, blue, and alpha values.static @NotNull ShadowColorshadowColor(@org.jetbrains.annotations.Range(from=0L, to=4294967295L) int value) Create a new shadow color from the ARGB value packed in an int.static @NotNull ShadowColorshadowColor(@NotNull ARGBLike argb) Create a shadow color from an existing ARGB colour.static @NotNull ShadowColorshadowColor(@NotNull RGBLike color, @org.jetbrains.annotations.Range(from=0L, to=255L) int alpha) Create a shadow color from an existing colour plus an alpha value.default voidstyleApply(@NotNull Style.Builder style) Applies tostyle.intvalue()The int-packed ARGB value of this shadow colour.Methods inherited from interface net.kyori.adventure.text.format.StyleBuilderApplicable
componentBuilderApply
-
Method Details
-
none
Return a shadow colour that will disable the shadow on a component.- Returns:
- a disabling shadow color
- Since:
- 4.18.0
-
shadowColor
@Contract(pure=true) @NotNull static @NotNull ShadowColor shadowColor(@org.jetbrains.annotations.Range(from=0L, to=4294967295L) int value) Create a new shadow color from the ARGB value packed in an int.- Parameters:
value- the int-packed ARGB value- Returns:
- a shadow color
- Since:
- 4.18.0
-
shadowColor
@Contract(pure=true) @NotNull static @NotNull ShadowColor shadowColor(@org.jetbrains.annotations.Range(from=0L, to=255L) int red, @org.jetbrains.annotations.Range(from=0L, to=255L) int green, @org.jetbrains.annotations.Range(from=0L, to=255L) int blue, @org.jetbrains.annotations.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
@Contract(pure=true) @NotNull static @NotNull ShadowColor shadowColor(@NotNull @NotNull RGBLike color, @org.jetbrains.annotations.Range(from=0L, to=255L) int alpha) Create a shadow color from an existing colour plus an alpha value.- Parameters:
color- 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) @Nullable static @Nullable ShadowColor fromHexString(@NotNull @NotNull String value) Attempt to parse a shadow colour from a#-prefixed hex string.This string should be in the format
#RRGGBBAA- Parameters:
value- 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
default @org.jetbrains.annotations.Range(from=0L, to=255L) int red()Get the red component of the shadow colour. -
green
default @org.jetbrains.annotations.Range(from=0L, to=255L) int green()Get the green component of the shadow colour. -
blue
default @org.jetbrains.annotations.Range(from=0L, to=255L) int blue()Get the blue component of the shadow colour. -
alpha
default @org.jetbrains.annotations.Range(from=0L, to=255L) int alpha()Get the alpha component of the shadow colour. -
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
-