Class ColorTool

java.lang.Object
com.jackmeng.halcyoninae.halcyon.utils.ColorTool

public final class ColorTool extends Object
A Class to manipulate Color utility
Since:
2.0
Author:
Jack Meng
  • Constructor Details

    • ColorTool

      private ColorTool()
  • Method Details

    • hexToRGBA

      public static Color hexToRGBA(String hex)
      Given a hex, it will return a Color Object representing the color.
      Parameters:
      hex - The hex to convert
      Returns:
      Color The color object
    • rgbTohex

      public static String rgbTohex(Color color)
      Convert a color object to a string hex representation.
      Parameters:
      color - The color to convert
      Returns:
      String The hex representation of the color
    • brightenColor

      public static Color brightenColor(Color c, int percent)
      Parameters:
      c -
      percent -
      Returns:
      Color
    • colorBreakDown

      public static int[] colorBreakDown(Color c)
      Returns an integer array representing the standard RED GREEN BLUE colors. Where arr[0]:RED arr[1]:GREEN arr[2]:BLUE. Alpha is not represented
      Parameters:
      c - A Color object (java.awt.Color)
      Returns:
      An integer array of length 3
    • getNullColor

      public static Color getNullColor()
      Get a color with 0 RED GREEN BLUE ALPHA
      Returns:
      A Color object (java.awt.Color)
    • rndColor

      public static Color rndColor()
      Returns a random color
      Returns:
      A color object (int8)