Class NamedTextColor

java.lang.Object
net.kyori.adventure.text.format.NamedTextColor
All Implemented Interfaces:
Comparable<TextColor>, ComponentBuilderApplicable, StyleBuilderApplicable, TextColor, TextFormat, RGBLike, net.kyori.examination.Examinable

public final class NamedTextColor
extends Object
implements TextColor
The named text colours in Minecraft: Java Edition.
Since:
4.0.0
  • Field Details

  • Method Details

    • ofExact

      public static @Nullable NamedTextColor ofExact​(int value)
      Gets the named color exactly matching the provided color.
      Parameters:
      value - the color to match
      Returns:
      the matched color, or null
      Since:
      4.0.0
    • nearestTo

      public static @NonNull NamedTextColor nearestTo​(@NonNull TextColor any)
      Find the named colour nearest to the provided colour.
      Parameters:
      any - colour to match
      Returns:
      nearest named colour. will always return a value
      Since:
      4.0.0
    • value

      public int value()
      Description copied from interface: TextColor
      The color, as an RGB value packed into an int.
      Specified by:
      value in interface TextColor
      Returns:
      the value
    • toString

      public @NonNull String toString()
      Overrides:
      toString in class Object