Class CssColorConverter

    • Constructor Detail

      • CssColorConverter

        public CssColorConverter()
    • Method Detail

      • parse

        public Color parse​(String text)
                    throws ConversionException
        Converts a value from its plain text representation to a Java object instance of the type returned by getValueType().
        Specified by:
        parse in interface Converter<Color>
        Parameters:
        text - The textual representation of the value. It must be either in hexadecimal format (e.g. "#FFFFFF" or "FFFFFF") or given by a string of comma-separated numbers, such as "255,255,255".
        Returns:
        The converted value.
        Throws:
        ConversionException - If the conversion fails.
      • format

        public String format​(Color value)
        Converts a value of the type returned by getValueType() to its plain text representation.
        Specified by:
        format in interface Converter<Color>
        Parameters:
        value - The value to be converted to text.
        Returns:
        The textual representation of the value.