Class ColorUtility


  • public class ColorUtility
    extends Object
    A helper class that enables the mapping of color names and color strings given as hex-strings to be mapped into java.awt.Color objects.
    • Constructor Detail

      • ColorUtility

        public ColorUtility()
        Creates a new value converter.
    • Method Detail

      • toAttributeValue

        public static String toAttributeValue​(Color c)
        Converts the attribute to a string.
        Parameters:
        c - the attribute (Integer expected).
        Returns:
        A string representing the Integer value.
      • toPropertyValue

        public static Color toPropertyValue​(String value)
        Converts a string to a Integer.
        Parameters:
        value - the string.
        Returns:
        a Integer.
      • getPredefinedExcelColors

        public static Color[] getPredefinedExcelColors()
        Returns the colors that are defined in Excel.
        Returns:
        the excel standard colors.
      • convertToGray

        public static Color convertToGray​(Color c,
                                          float x)
      • convertToBrighter

        public static Color convertToBrighter​(Color c)
      • convertToDarker

        public static Color convertToDarker​(Color c)
      • getBrightness

        public static int getBrightness​(Color color)