Class ColorUtil

java.lang.Object
de.julianweinelt.datacat.dbx.util.ColorUtil

public class ColorUtil extends Object
Utility class for parsing colors. Colors are converted in a database-friendly String format:
rrr;ggg;bbb;aaa
Version:
1.0.0
Author:
Julian Weinelt
  • Constructor Details

    • ColorUtil

      public ColorUtil()
  • Method Details

    • toString

      public static String toString(Color color)
      Convert a Color to a String
      Parameters:
      color - The Color object to convert
      Returns:
      The color in the text format rrr;ggg;bbb;aaa
    • toColor

      public static Color toColor(String color)
      Convert a text into a Color using the format rrr;ggg;bbb;aaa
      Parameters:
      color - The String to convert
      Returns:
      A Color object created from the text
      Throws:
      InvalidColorException - if the entered text cannot be parsed to a color.
    • isValidRGBA

      public static boolean isValidRGBA(String input)