Class NamedTextColor

    • Field Detail

      • BLACK

        public static final NamedTextColor BLACK
        The standard black colour.
        Since:
        4.0.0
      • DARK_BLUE

        public static final NamedTextColor DARK_BLUE
        The standard dark_blue colour.
        Since:
        4.0.0
      • DARK_GREEN

        public static final NamedTextColor DARK_GREEN
        The standard dark_green colour.
        Since:
        4.0.0
      • DARK_AQUA

        public static final NamedTextColor DARK_AQUA
        The standard dark_aqua colour.
        Since:
        4.0.0
      • DARK_RED

        public static final NamedTextColor DARK_RED
        The standard dark_red colour.
        Since:
        4.0.0
      • DARK_PURPLE

        public static final NamedTextColor DARK_PURPLE
        The standard dark_purple colour.
        Since:
        4.0.0
      • GOLD

        public static final NamedTextColor GOLD
        The standard gold colour.
        Since:
        4.0.0
      • GRAY

        public static final NamedTextColor GRAY
        The standard gray colour.
        Since:
        4.0.0
      • DARK_GRAY

        public static final NamedTextColor DARK_GRAY
        The standard dark_gray colour.
        Since:
        4.0.0
      • BLUE

        public static final NamedTextColor BLUE
        The standard blue colour.
        Since:
        4.0.0
      • GREEN

        public static final NamedTextColor GREEN
        The standard green colour.
        Since:
        4.0.0
      • AQUA

        public static final NamedTextColor AQUA
        The standard aqua colour.
        Since:
        4.0.0
      • RED

        public static final NamedTextColor RED
        The standard red colour.
        Since:
        4.0.0
      • LIGHT_PURPLE

        public static final NamedTextColor LIGHT_PURPLE
        The standard light_purple colour.
        Since:
        4.0.0
      • YELLOW

        public static final NamedTextColor YELLOW
        The standard yellow colour.
        Since:
        4.0.0
      • WHITE

        public static final NamedTextColor WHITE
        The standard white colour.
        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, use namedColor(int) instead
        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

        @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: TextColor
        The color, as an RGB value packed into an int.
        Specified by:
        value in interface TextColor
        Returns:
        the value
      • asHSV

        @NotNull
        public @NotNull HSVLike asHSV()
        Description copied from interface: RGBLike
        Converts the color represented by this RGBLike to the HSV color space.
        Specified by:
        asHSV in interface RGBLike
        Returns:
        an HSVLike representing this RGBLike in the HSV color space
      • toString

        @NotNull
        public @NotNull java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • examinableProperties

        @NotNull
        public @NotNull java.util.stream.Stream<? extends net.kyori.examination.ExaminableProperty> examinableProperties()
        Specified by:
        examinableProperties in interface net.kyori.examination.Examinable
        Specified by:
        examinableProperties in interface TextColor