Class ColorUtils

java.lang.Object
me.emafire003.dev.coloredglowlib.util.ColorUtils

public class ColorUtils extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
     
    static boolean
    checkSameColor(String color, String color1)
     
    static boolean
    Checks if a given color is a custom animation added by a datapack
    static boolean
    Checks if a given String represents a Color in Hexadecimal format.
    static boolean
    Checks is a given string is actually a valid color It's here instead of in the API because it is sometimes needed before the server loads
    static boolean
    Checks is a given string is actually a valid color It's here instead of in the API because it is sometimes needed before the server loads
    static int
    toColorValue(int r, int g, int b)
    Converts RGB decimal numbers into a single Color value
    static int
    Converts a given string to an integer Color value The string is checked with isHexColor to confirm it's indeed a color in hex string format.
    static String
    toHex(int colorValue)
    Converts a given integer Color value to an
    static String
    toHex(int r, int g, int b)
     
    static int[]
    toRGB(String color)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ColorUtils

      public ColorUtils()
  • Method Details

    • isHexColor

      public static boolean isHexColor(String str)
      Checks if a given String represents a Color in Hexadecimal format. The string can start with or without "#"
      Parameters:
      str - The supposed string color to check
      Returns:
      Returns weather teh givin string is a color or not
    • toColorValue

      public static int toColorValue(int r, int g, int b)
      Converts RGB decimal numbers into a single Color value
      Parameters:
      r - The red RGB value (0-255)
      g - The green RGB value (0-255)
      b - The blue RGB value (0-255)
    • toColorValue

      public static int toColorValue(String hex)
      Converts a given string to an integer Color value The string is checked with isHexColor to confirm it's indeed a color in hex string format. The string can start with or without "#"
      Parameters:
      hex - The string representing the color in hexadecimal format
      Returns:
      Returns the color value corresponding to the string, or black if the string was not a color
    • toHex

      public static String toHex(int colorValue)
      Converts a given integer Color value to an
    • toHex

      public static String toHex(int r, int g, int b)
    • checkDefault

      public static boolean checkDefault(String color)
    • checkSameColor

      public static boolean checkSameColor(String color, String color1)
    • toRGB

      public static int[] toRGB(String color)
    • isValidColor

      public static boolean isValidColor(String color)
      Checks is a given string is actually a valid color It's here instead of in the API because it is sometimes needed before the server loads
    • isValidColorOrCustom

      public static boolean isValidColorOrCustom(String color)
      Checks is a given string is actually a valid color It's here instead of in the API because it is sometimes needed before the server loads
    • isCustomAnimation

      public static boolean isCustomAnimation(String color)
      Checks if a given color is a custom animation added by a datapack