Package net.kyori.adventure.text.format
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
The named text colours in Minecraft: Java Edition.
- Since:
- 4.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NamedTextColor
The standardaqua
colour.static final NamedTextColor
The standardblack
colour.static final NamedTextColor
The standardblue
colour.static final NamedTextColor
The standarddark_aqua
colour.static final NamedTextColor
The standarddark_blue
colour.static final NamedTextColor
The standarddark_gray
colour.static final NamedTextColor
The standarddark_green
colour.static final NamedTextColor
The standarddark_purple
colour.static final NamedTextColor
The standarddark_red
colour.static final NamedTextColor
The standardgold
colour.static final NamedTextColor
The standardgray
colour.static final NamedTextColor
The standardgreen
colour.static final NamedTextColor
The standardlight_purple
colour.static final Index<String,
NamedTextColor> An index of name to color.static final NamedTextColor
The standardred
colour.static final NamedTextColor
The standardwhite
colour.static final NamedTextColor
The standardyellow
colour.Fields inherited from interface net.kyori.adventure.text.format.TextColor
HEX_CHARACTER, HEX_PREFIX
-
Method Summary
Modifier and TypeMethodDescription@NotNull HSVLike
asHSV()
Converts the color represented by this RGBLike to the HSV color space.@NotNull Stream<? extends net.kyori.examination.ExaminableProperty>
static @Nullable NamedTextColor
namedColor
(int value) Gets the named color exactly matching the provided color.static @NotNull NamedTextColor
Find the named colour nearest to the provided colour.static @Nullable NamedTextColor
ofExact
(int value) Deprecated.@NotNull String
toString()
int
value()
The color, as an RGB value packed into an int.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.kyori.examination.Examinable
examinableName, examine
Methods inherited from interface net.kyori.adventure.text.format.StyleBuilderApplicable
componentBuilderApply
Methods inherited from interface net.kyori.adventure.text.format.TextColor
asHexString, blue, compareTo, green, red, styleApply
-
Field Details
-
BLACK
The standardblack
colour.- Since:
- 4.0.0
-
DARK_BLUE
The standarddark_blue
colour.- Since:
- 4.0.0
-
DARK_GREEN
The standarddark_green
colour.- Since:
- 4.0.0
-
DARK_AQUA
The standarddark_aqua
colour.- Since:
- 4.0.0
-
DARK_RED
The standarddark_red
colour.- Since:
- 4.0.0
-
DARK_PURPLE
The standarddark_purple
colour.- Since:
- 4.0.0
-
GOLD
The standardgold
colour.- Since:
- 4.0.0
-
GRAY
The standardgray
colour.- Since:
- 4.0.0
-
DARK_GRAY
The standarddark_gray
colour.- Since:
- 4.0.0
-
BLUE
The standardblue
colour.- Since:
- 4.0.0
-
GREEN
The standardgreen
colour.- Since:
- 4.0.0
-
AQUA
The standardaqua
colour.- Since:
- 4.0.0
-
RED
The standardred
colour.- Since:
- 4.0.0
-
LIGHT_PURPLE
The standardlight_purple
colour.- Since:
- 4.0.0
-
YELLOW
The standardyellow
colour.- Since:
- 4.0.0
-
WHITE
The standardwhite
colour.- Since:
- 4.0.0
-
NAMES
An index of name to color.- Since:
- 4.0.0
-
-
Method Details
-
namedColor
Gets the named color exactly matching the provided color.- Parameters:
value
- the color to match- Returns:
- the matched color, or null
- Since:
- 4.10.0
-
ofExact
@Deprecated @ScheduledForRemoval(inVersion="5.0.0") @Nullable public static @Nullable NamedTextColor ofExact(int value) Deprecated.for removal since 4.10.0, usenamedColor(int)
insteadGets 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
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. -
asHSV
Description copied from interface:RGBLike
Converts the color represented by this RGBLike to the HSV color space. -
toString
-
examinableProperties
@NotNull public @NotNull Stream<? extends net.kyori.examination.ExaminableProperty> examinableProperties()- Specified by:
examinableProperties
in interfacenet.kyori.examination.Examinable
- Specified by:
examinableProperties
in interfaceTextColor
-
namedColor(int)
instead