Class ColorUtil

java.lang.Object
com.marcusslover.plus.lib.text.ColorUtil

public class ColorUtil extends Object
  • Field Details

    • HEX_TO_BUKKIT

      public static final Pattern HEX_TO_BUKKIT
    • HEX_FROM_BUKKIT

      public static final Pattern HEX_FROM_BUKKIT
    • COLOR_CHAR

      public static final char COLOR_CHAR
      See Also:
  • Method Details

    • hex

      @NotNull public static @NotNull String hex(@NotNull @NotNull String text)
    • color

      @NotNull public static @NotNull String color(@NotNull @NotNull String textToTranslate)
    • color

      @NotNull public static @NotNull String color(char altColorChar, @NotNull @NotNull String textToTranslate)
    • legacySection

      @NotNull public static @NotNull net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer legacySection()
    • legacyAmpersand

      @NotNull public static @NotNull net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer legacyAmpersand()
    • hexTranslation

      @NotNull public static @NotNull String hexTranslation(@NotNull @NotNull String text)
    • getRGBFromCode

      @NotNull public static @NotNull org.bukkit.Color getRGBFromCode(@NotNull @NotNull String value)
      Convert color codes and hex codes to Color container (RGB Container)
      Parameters:
      value - Must match one of these formats "#FFFFFF" or "ampersand-c"
      Returns:
      org.bukkit.Color
    • hex2Rgb

      @NotNull public static @NotNull org.bukkit.Color hex2Rgb(@NotNull @NotNull String value)
      Converts "#FFFFFF" format to a Color object containing RGB values
      Parameters:
      value - Must be in format "#FFFFFF"
      Returns:
      org.bukkit.Color
    • minecraft2Rgb

      @NotNull public static @NotNull org.bukkit.Color minecraft2Rgb(@NotNull @NotNull String value)
      Converts ampersand-c format to a Color object containing RGB values
      Parameters:
      value - Must be in format "ampersand-0"
      Returns:
      org.bukkit.Color
    • dyeToChat

      @NotNull public static @NotNull net.md_5.bungee.api.ChatColor dyeToChat(@NotNull @NotNull org.bukkit.DyeColor dye)
    • materialToDye

      @NotNull public static @NotNull org.bukkit.DyeColor materialToDye(@NotNull @NotNull org.bukkit.Material material)
    • materialToChat

      @NotNull public static @NotNull net.md_5.bungee.api.ChatColor materialToChat(@NotNull @NotNull org.bukkit.Material material)
    • translateList

      @NotNull public static @NotNull List<String> translateList(@NotNull @NotNull List<String> lore)