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.

@FunctionalInterface public static interface TextLayer.GlyphColor
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    adjustColor(int color)
    Adjust the color to be fully opaque if it's very close to having 0 alpha.
    always(int color)
    Always use the given color, regardless of the style.
    int
    color(@Nullable net.minecraft.network.chat.TextColor textColor)
    Convert a nullable text color to a color.
    defaultTo(int color)
    Default to the given color if no color is specified in the style.
    defaultTo(int color, float dimFactor)
    Default to the given color if no color is specified in the style.
  • Method Details

    • defaultTo

      static TextLayer.GlyphColor defaultTo(int color, float dimFactor)
      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

      static TextLayer.GlyphColor defaultTo(int color)
      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

      static TextLayer.GlyphColor always(int color)
      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.