Function painter:setcolor
sets the color of both the
current brush
and current pen.
There are several ways to specify a color:
painter:setcolor(qcolor)
Argument qcolor
is a Qt variant of class qt.QColor
.
painter:setcolor(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.
painter:setcolor(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.