Class ColorUtils


  • public class ColorUtils
    extends Object
    • Method Detail

      • toColor

        public static Color toColor​(String colorString)
        Creates a Color from a string.
        Parameters:
        colorString - color string representation (#XXX, #XXXXXX or the name of the color like red, green etc.)
        Returns:
        the color, null if no color matches to the given color string
      • toColor

        public static Color toColor​(String colorString,
                                    Color defaultColor)
        Creates a Color from a string.
        Parameters:
        colorString - color string representation (#XXX, #XXXXXX or the name of the color like red, green etc.)
        defaultColor - the fallback color (if the text to Color transformation didn't work)
        Returns:
        the color