To set the color of an HTML5 Canvas line, we can use the strokeStyle property of the canvas context, which can be set to a color string such as red, green, or blue, a hex value such as #FF0000 or #555, or an RGB value such as rgb(255, 0, 0). Sets the style used when filling shapes. By default, the stroke and fill color are set to black (CSS color value #000000). The above example would produce the following result −. HML5 Canvas Tutorial : The basics of HTML 5 canvas which provides an easy and powerful way to draw graphics using JavaScript. Ein canvas Element ist ein Rechteck, in dem man Grafiken darstellen kann, also eine Art Zeichenbrett. Because the canvas is an HTML element, you can use CSS styles to modify its position, assign it a background color or image, add a border, and so on. Copied. A canvas is a rectangular area on an HTML page. HTML5 Canvas Text Font, Size, and Style Tutorial. The HTML