
Applying styles and colors using canvas
Canvas elements can be used to give colors also in the previous post we discussed various drawing functionalities in a canvas element. In this post, we shall discuss the coloring features in the canvas element.
Colors
There are two properties that canvas element provide us to apply colors to shapes
fillStyle = colorstrokeStyle = color
strokeStyle parameter helps in defining the outline color of the shape.
lifestyle parameter helps in coloring inside the shape.
Any CSS color code can be used here.//these all set the fillStyle to 'orange' ctx.fillStyle = "orange"; ctx.fillStyle = "#FFA500"; ctx.fillStyle = "rgb(255,165,0)"; ctx.fillStyle = "rgba(255,165,0,1)";



