fillStyle property
Gets or sets the current style that is used to fill shapes.
![]() ![]() |
Syntax
object.put_fillStyle( v);object.get_fillStyle(* p);
Property values
Type: VARIANT
The fill style, as specified by one of the following values:
CSS color
-
A string that contains a CSS color value to create a solid color fill (for example, blue, red, or black).
Gradient
-
A CanvasGradient object to create a gradient fill.
repeat-y
-
A CanvasPattern object to create a pattern fill.
no-repeat
-
The pattern prints only once and does not repeat.
Exceptions
| Exception | Condition |
|---|---|
|
The p attribute is set to an CanvasPattern object that was created from a img or video element that is not of the same origin or domain as the document that owns the canvas element. |
Standards information
- HTML Canvas 2D Context, Section 5
Remarks
Invalid values are ignored.
Build date: 11/12/2012

