There are several ways to construct a Qt variant of class qt.QColor
.
qt.QColor(r,g,b,[a])
Arguments r
, g
, b
, and a
are numbers in range [0,1]
representing the intensities of the red, green, blue, and alpha channels.
The default value for argument a
is 1
for a fully opaque color.
qt.QColor(string)
Argument string
is a string representing a color name.
All SVG color names
are recognized.Color names can have also the format "#RGB"
,
"#RRGGBB"
, "#RRRGGGBBB"
, or ="#RRRRGGGGBBBB"
where letters R
, G
, or B
represent hexadecimal
digits for each of the color component.
qt.QColor(table)
Argument table
is a table whose fields r
, g
, b
and a
contain numbers in range [0,1]
representing the intensities
of the red, green, blue, and alpha channels. Such a table
is returned by function qcolor:totable()
.