Package net.minecraft.text
Class TextColor
java.lang.Object
net.minecraft.text.TextColor
- See Also:
- Mappings:
Namespace Name official uj
intermediary net/minecraft/class_5251
named net/minecraft/text/TextColor
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<TextColor>
private static final Map<Formatting,
TextColor> private final int
private static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
fromFormatting
(Formatting formatting) Obtains a text color from a formatting.static TextColor
fromRgb
(int rgb) Obtains a text color from an RGB value.private String
getName()
Gets the name of this color, used for converting the color to JSON format.int
getRgb()
Gets the RGB value of this color.int
hashCode()
Parses a color by its name.toString()
-
Field Details
-
RGB_PREFIX
- See Also:
- Mappings:
Namespace Name Mixin selector official b
Luj;b:Ljava/lang/String;
intermediary field_33291
Lnet/minecraft/class_5251;field_33291:Ljava/lang/String;
named RGB_PREFIX
Lnet/minecraft/text/TextColor;RGB_PREFIX:Ljava/lang/String;
-
CODEC
- Mappings:
Namespace Name Mixin selector official a
Luj;a:Lcom/mojang/serialization/Codec;
intermediary field_39242
Lnet/minecraft/class_5251;field_39242:Lcom/mojang/serialization/Codec;
named CODEC
Lnet/minecraft/text/TextColor;CODEC:Lcom/mojang/serialization/Codec;
-
FORMATTING_TO_COLOR
- Mappings:
Namespace Name Mixin selector official c
Luj;c:Ljava/util/Map;
intermediary field_24362
Lnet/minecraft/class_5251;field_24362:Ljava/util/Map;
named FORMATTING_TO_COLOR
Lnet/minecraft/text/TextColor;FORMATTING_TO_COLOR:Ljava/util/Map;
-
BY_NAME
- Mappings:
Namespace Name Mixin selector official d
Luj;d:Ljava/util/Map;
intermediary field_24363
Lnet/minecraft/class_5251;field_24363:Ljava/util/Map;
named BY_NAME
Lnet/minecraft/text/TextColor;BY_NAME:Ljava/util/Map;
-
rgb
private final int rgb- Mappings:
Namespace Name Mixin selector official e
Luj;e:I
intermediary field_24364
Lnet/minecraft/class_5251;field_24364:I
named rgb
Lnet/minecraft/text/TextColor;rgb:I
-
name
- Mappings:
Namespace Name Mixin selector official f
Luj;f:Ljava/lang/String;
intermediary field_24365
Lnet/minecraft/class_5251;field_24365:Ljava/lang/String;
named name
Lnet/minecraft/text/TextColor;name:Ljava/lang/String;
-
-
Constructor Details
-
TextColor
- Mappings:
Namespace Name Mixin selector official <init>
Luj;<init>(ILjava/lang/String;)V
intermediary <init>
Lnet/minecraft/class_5251;<init>(ILjava/lang/String;)V
named <init>
Lnet/minecraft/text/TextColor;<init>(ILjava/lang/String;)V
-
TextColor
private TextColor(int rgb) - Mappings:
Namespace Name Mixin selector official <init>
Luj;<init>(I)V
intermediary <init>
Lnet/minecraft/class_5251;<init>(I)V
named <init>
Lnet/minecraft/text/TextColor;<init>(I)V
-
-
Method Details
-
getRgb
public int getRgb()Gets the RGB value of this color.The red bits can be obtained by
(rgb >> 16) & 0xFF
, green bits by(rgb >> 8) & 0xFF
, blue bits byrgb & 0xFF
.- Mappings:
Namespace Name Mixin selector official a
Luj;a()I
intermediary method_27716
Lnet/minecraft/class_5251;method_27716()I
named getRgb
Lnet/minecraft/text/TextColor;getRgb()I
-
getName
Gets the name of this color, used for converting the color to JSON format.- Mappings:
Namespace Name Mixin selector official b
Luj;b()Ljava/lang/String;
intermediary method_27721
Lnet/minecraft/class_5251;method_27721()Ljava/lang/String;
named getName
Lnet/minecraft/text/TextColor;getName()Ljava/lang/String;
-
getHexCode
- Mappings:
Namespace Name Mixin selector official c
Luj;c()Ljava/lang/String;
intermediary method_27723
Lnet/minecraft/class_5251;method_27723()Ljava/lang/String;
named getHexCode
Lnet/minecraft/text/TextColor;getHexCode()Ljava/lang/String;
-
equals
-
hashCode
public int hashCode() -
toString
-
fromFormatting
Obtains a text color from a formatting.- Parameters:
formatting
- the formatting- Mappings:
Namespace Name Mixin selector official a
Luj;a(Ln;)Luj;
intermediary method_27718
Lnet/minecraft/class_5251;method_27718(Lnet/minecraft/class_124;)Lnet/minecraft/class_5251;
named fromFormatting
Lnet/minecraft/text/TextColor;fromFormatting(Lnet/minecraft/util/Formatting;)Lnet/minecraft/text/TextColor;
-
fromRgb
Obtains a text color from an RGB value.- Parameters:
rgb
- the RGB color- Mappings:
Namespace Name Mixin selector official a
Luj;a(I)Luj;
intermediary method_27717
Lnet/minecraft/class_5251;method_27717(I)Lnet/minecraft/class_5251;
named fromRgb
Lnet/minecraft/text/TextColor;fromRgb(I)Lnet/minecraft/text/TextColor;
-
parse
Parses a color by its name.- Parameters:
name
- the name- Mappings:
Namespace Name Mixin selector official a
Luj;a(Ljava/lang/String;)Luj;
intermediary method_27719
Lnet/minecraft/class_5251;method_27719(Ljava/lang/String;)Lnet/minecraft/class_5251;
named parse
Lnet/minecraft/text/TextColor;parse(Ljava/lang/String;)Lnet/minecraft/text/TextColor;
-