CRC — the rendering context for drawing on a canvas


readonly Canvas canvas

The Canvas element upon which this context will draw.

Object fillStyle

The current color, pattern, or gradient used for filling paths. This property may be set to a CSS color string or to a CanvasGradient or CanvasPattern object. The default fill style is solid black. See also CRC.createLinearGradient(), CRC.createRadialGradient(), and CRC.createPattern().

String font

The font to be used by text-drawing methods, specified as a string, using the same syntax as the CSS font attribute. The default is “10px sans-serif”. If the font string uses font size units like “em” or “ex” or uses relative keywords like “larger”, “smaller”, “bolder”, or “lighter”, then these are interpreted relative to the computed style of the CSS font of the <canvas> element.

float globalAlpha

Specifies additional transparency to be added to everything drawn on the canvas. The alpha value of all pixels drawn on the canvas is multiplied by the value of this property. The value must be a number between 0.0 (makes everything completely transparent) and 1.0 (the default: adds no additional transparency).

String globalCompositeOperation

Specifies how colors being drawn are combined (or “composited”) with colors already on the canvas. See the individual reference entry for this property for possible values. The default value is “source-over”.

String lineCap

Specifies how the ends of lines are rendered. Legal values are “butt”, “round”, and ...

Get Canvas Pocket Reference now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.