photonui.Color
is a class that abstracts colors. It supports two colorimetric spaces (RGB and HSL ) and multiple representations (hexadecimal, CSS rgb()
/rgba()
,…).
To see it in action, please look at the photonui.ColorPickerDiaog
documentation.
Class Reference
More examples 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 var color = new photonui.Color("red" );console .log(color.rgbHexString);console .log(color.rgbaHexString);console .log(color.cssRgbString);console .log(color.cssRgbaString);console .log(color.getRGB());console .log(color.getRGBA());console .log(color.red, color.green, color.blue);console .log(color.hue, color.saturation, color.brightness);color.brightness = 50 ; console .log(color.rgbHexString);color.hue = 204 ; console .log(color.rgbHexString);