Promotic
WikipediaLinkedInYoutubeTwitterFacebook

fillStyle - property of the CanvasCtx object

Description:
Sets or returns the fill color or gradient
Syntax:
String fillStyle
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 - 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.
See also:
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";

History:
Pm8.02.06: Created
PROMOTIC 9.0.13 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice