CssColor Type
The CssColor
type is capable of holding a color and alpha value.
CssColor CssColor.fromRgb(red, green, blue)
This construction function creates a new color object from the components provided in the red
, green
and blue
parameters. The object's CssColor.alpha property will be 1.0 when using this function. Here is how to create a valid Color object:
orange = CssColor.fromgRgb(235, 155, 52)
var orange = CssColor.fromRgb(235, 155, 52)
my $orange = CssColor::fromRgb(235, 155, 52)
orange = CssColor.fromRgb(235, 155, 52)
set color [invoke CssColor fromgRgb 235 155 52]
CssColor CssColor.fromRgba(red, green, blue, alpha)
This construction function creates a new color object from the components provided in the red
, green
, blue
and alpha
parameters. Here is how to create a valid CssColor object:
orange = CssColor.fromgRgba(235, 155, 52, 0.5)
var orange = CssColor.fromRgba(235, 155, 52, 0.5)
my $orange = CssColor::fromRgba(235, 155, 52, 0.5)
orange = CssColor.fromRgba(235, 155, 52, 0.5)
set color [invoke CssColor fromgRgba 235 155 52, 0.5]
CssColor
objects have the following properties:
int CssColor.red
This read/write property holds the color's red component value. It will be in the range 0-255.
int CssColor.green
This read/write property holds the color's green component value. It will be in the range 0-255.
int CssColor.blue
This read/write property holds the color's blue component value. It will be in the range 0-255.
double CssColor.alpha
This read/write property holds the color's alpha component value. It will be in the range 0-1.0.
boolean CssColor.isValid
This read-only property indicates if the other properties of the object are valid. Invalid color values may be provided by Squish when there was a problem obtaining a color.
© 2024 The Qt Company Ltd.
Documentation contributions included herein are the copyrights of
their respective owners.
The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.
Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners.