Package net.kyori.adventure.text.format
Class NamedTextColor
- java.lang.Object
-
- net.kyori.adventure.text.format.NamedTextColor
-
- All Implemented Interfaces:
java.lang.Comparable<TextColor>,ComponentBuilderApplicable,StyleBuilderApplicable,TextColor,TextFormat,RGBLike,net.kyori.examination.Examinable
public final class NamedTextColor extends java.lang.Object implements TextColor
The named text colours in Minecraft: Java Edition.- Since:
- 4.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static NamedTextColorAQUAThe standardaquacolour.static NamedTextColorBLACKThe standardblackcolour.static NamedTextColorBLUEThe standardbluecolour.static NamedTextColorDARK_AQUAThe standarddark_aquacolour.static NamedTextColorDARK_BLUEThe standarddark_bluecolour.static NamedTextColorDARK_GRAYThe standarddark_graycolour.static NamedTextColorDARK_GREENThe standarddark_greencolour.static NamedTextColorDARK_PURPLEThe standarddark_purplecolour.static NamedTextColorDARK_REDThe standarddark_redcolour.static NamedTextColorGOLDThe standardgoldcolour.static NamedTextColorGRAYThe standardgraycolour.static NamedTextColorGREENThe standardgreencolour.static NamedTextColorLIGHT_PURPLEThe standardlight_purplecolour.static Index<java.lang.String,NamedTextColor>NAMESAn index of name to color.static NamedTextColorREDThe standardredcolour.static NamedTextColorWHITEThe standardwhitecolour.static NamedTextColorYELLOWThe standardyellowcolour.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description @NotNull HSVLikeasHSV()Converts the color represented by this RGBLike to the HSV color space.@NotNull java.util.stream.Stream<? extends net.kyori.examination.ExaminableProperty>examinableProperties()static @Nullable NamedTextColornamedColor(int value)Gets the named color exactly matching the provided color.static @NotNull NamedTextColornearestTo(@NotNull TextColor any)Find the named colour nearest to the provided colour.static @Nullable NamedTextColorofExact(int value)Deprecated.for removal since 4.10.0, usenamedColor(int)instead@NotNull java.lang.StringtoString()intvalue()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.adventure.text.format.StyleBuilderApplicable
componentBuilderApply
-
Methods inherited from interface net.kyori.adventure.text.format.TextColor
asHexString, blue, compareTo, green, red, styleApply
-
-
-
-
Field Detail
-
BLACK
public static final NamedTextColor BLACK
The standardblackcolour.- Since:
- 4.0.0
-
DARK_BLUE
public static final NamedTextColor DARK_BLUE
The standarddark_bluecolour.- Since:
- 4.0.0
-
DARK_GREEN
public static final NamedTextColor DARK_GREEN
The standarddark_greencolour.- Since:
- 4.0.0
-
DARK_AQUA
public static final NamedTextColor DARK_AQUA
The standarddark_aquacolour.- Since:
- 4.0.0
-
DARK_RED
public static final NamedTextColor DARK_RED
The standarddark_redcolour.- Since:
- 4.0.0
-
DARK_PURPLE
public static final NamedTextColor DARK_PURPLE
The standarddark_purplecolour.- Since:
- 4.0.0
-
GOLD
public static final NamedTextColor GOLD
The standardgoldcolour.- Since:
- 4.0.0
-
GRAY
public static final NamedTextColor GRAY
The standardgraycolour.- Since:
- 4.0.0
-
DARK_GRAY
public static final NamedTextColor DARK_GRAY
The standarddark_graycolour.- Since:
- 4.0.0
-
BLUE
public static final NamedTextColor BLUE
The standardbluecolour.- Since:
- 4.0.0
-
GREEN
public static final NamedTextColor GREEN
The standardgreencolour.- Since:
- 4.0.0
-
AQUA
public static final NamedTextColor AQUA
The standardaquacolour.- Since:
- 4.0.0
-
RED
public static final NamedTextColor RED
The standardredcolour.- Since:
- 4.0.0
-
LIGHT_PURPLE
public static final NamedTextColor LIGHT_PURPLE
The standardlight_purplecolour.- Since:
- 4.0.0
-
YELLOW
public static final NamedTextColor YELLOW
The standardyellowcolour.- Since:
- 4.0.0
-
WHITE
public static final NamedTextColor WHITE
The standardwhitecolour.- Since:
- 4.0.0
-
NAMES
public static final Index<java.lang.String,NamedTextColor> NAMES
An index of name to color.- Since:
- 4.0.0
-
-
Method Detail
-
namedColor
@Nullable public static @Nullable NamedTextColor namedColor(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.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
@NotNull public static @NotNull NamedTextColor nearestTo(@NotNull @NotNull 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:TextColorThe color, as an RGB value packed into an int.
-
asHSV
@NotNull public @NotNull HSVLike asHSV()
Description copied from interface:RGBLikeConverts the color represented by this RGBLike to the HSV color space.
-
toString
@NotNull public @NotNull java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
examinableProperties
@NotNull public @NotNull java.util.stream.Stream<? extends net.kyori.examination.ExaminableProperty> examinableProperties()
- Specified by:
examinablePropertiesin interfacenet.kyori.examination.Examinable- Specified by:
examinablePropertiesin interfaceTextColor
-
-