Class ColorConverter

java.lang.Object
preponderous.ponder.minecraft.bukkit.tools.ColorConverter

public class ColorConverter extends Object
Since:
23/09/2021 - 22:39
  • Constructor Details

    • ColorConverter

      public ColorConverter()
  • Method Details

    • attemptDecode

      @Nullable public @Nullable String attemptDecode(@NotNull @NotNull String input, boolean ideTest)
      The attemptDecode method uses multiple parsing methodologies to determine the hex representation of the given input String.

      Examples of input could be: 'red', 'blue', 'light_blue' etc. etc.
      Hopeful output could be: '#f00' etc. etc.

      If the value isn't parsed successfully, this method returns null.

      Parameters:
      input - string to convert into hexadecimal.
      ideTest - to be used by test-cases, Bukkit isn't set to be provided during runtime, or compiled, which means an error will be thrown if the Class isn't found while testing.
      Returns:
      hexadecimal representation or null.
      See Also:
      Color, Color