fillStyle - property of the CanvasCtx object
Description:
The property returns or sets the fill color or gradient
Values:
color (default) - Color value according to
CSS specification. The default color is
#000000.
#RRGGBB -
RGB String (represents a color) is written in the form
"#RRGGBB". ("#ff0000" = red)
rgb(R,G,B) - RGB color ("rgb(255,0,0)" = red)
rgba(R,G,B,A) - RGBA color ("rgba(255,0,0,0.5)" - red transparent) (4th parameter in the range from 0 to 1)
HTML name color - "red" - HTML named color
gradient - The reference to a gradient object (
linear or
radial) used to create a color gradient.
Note:
Property access
for read and write.
This method is also functional in
Web panels.
Example:
The
ctx variable represents the drawing canvas (
CanvasCtx). The setup is done on the "
Draw" tab at the beginning of the script of drawing event
onDraw as follows:
var ctx =
pEvent.
GetCtx(1);
JavaScriptSelect and copy to clipboard
ctx.fillStyle = "#ff0000";