Package dev.engine_room.vanillin.text
Interface TextLayer.GlyphColor
- Enclosing interface:
TextLayer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intadjustColor(int color) Adjust the color to be fully opaque if it's very close to having 0 alpha.static TextLayer.GlyphColoralways(int color) Always use the given color, regardless of the style.intcolor(@Nullable net.minecraft.network.chat.TextColor textColor) Convert a nullable text color to a color.static TextLayer.GlyphColordefaultTo(int color) Default to the given color if no color is specified in the style.static TextLayer.GlyphColordefaultTo(int color, float dimFactor) Default to the given color if no color is specified in the style.
-
Method Details
-
defaultTo
Default to the given color if no color is specified in the style.- Parameters:
color- The ARGB color to default to.- Returns:
- A new GlyphColor.
-
defaultTo
Default to the given color if no color is specified in the style.- Parameters:
color- The ARGB color to default to.- Returns:
- A new GlyphColor.
-
always
Always use the given color, regardless of the style.- Parameters:
color- The ARGB color to use.- Returns:
- A new GlyphColor.
-
adjustColor
static int adjustColor(int color) Adjust the color to be fully opaque if it's very close to having 0 alpha.- Parameters:
color- The ARGB color to adjust.- Returns:
- The adjusted color.
-
color
int color(@Nullable @Nullable net.minecraft.network.chat.TextColor textColor) Convert a nullable text color to a color.- Parameters:
textColor- The color of the text to colorize.- Returns:
- The color to use, in ARGB format.
-