Class ColorBuilder


  • public final class ColorBuilder
    extends Object
    Utility to create colors by red, green and blue values, HEX value and RGB and RGBA strings.
    It checks if the requested color is already defined in HTML colors.
    Author:
    Andrea "Stock" Stocchero
    See Also:
    HtmlColor, GwtMaterialColor
    • Method Detail

      • parse

        public static List<IsColor> parse​(List<String> colorsAsString)
        Builds a list of colors starting from a list of strings which represent colors.
        Parameters:
        colorsAsString - list of strings which represent colors
        Returns:
        a list of colors
      • build

        public static IsColor build​(int r,
                                    int g,
                                    int b)
        Creates a color using red, green and blue channels.
        Parameters:
        r - red channel
        g - green channel
        b - blue channel
        Returns:
        a color instance
      • parse

        public static IsColor parse​(String value)
        Returns a color parsing the string value passed as argument.
        It's able to parse HEX, RGB, RGBA and named color representation.
        Parameters:
        value - value to parse
        Returns:
        color instance