Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public final class Colors
- Object
- Colors
Parses and formats CSS colors.
Methods
public static int parse(String s, int def) | Parses #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(), rgba(), hsl(), hsla(), a named color or transparent. |
public static String toHex(int argb) | Formats a color as #rrggbb, ignoring alpha. |
Inherited methods
Method details
parse
public static int parse(String s, int def)Parses
#rgb, #rgba, #rrggbb, #rrggbbaa, rgb(), rgba(), hsl(), hsla(),
a named color or transparent.Parameters
sString- the color text
defint- returned when
sis null or not a color
Returns
the color as
0xAARRGGBBtoHex
public static String toHex(int argb)Formats a color as
#rrggbb, ignoring alpha.Parameters
argbint- the color