Changing the fill color of a shapeSection

by jcubed111

HTML

<!-- Learn about this code on MDN: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle -->

<canvas id="canvas"></canvas>

JavaScript

const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');

ctx.fillStyle = `repeating-linear-gradient(
                45deg,
                #00000000 0px,
                #00000000 10px,
                #000000ff 10px,
                #000000ff 20px
            );`;
ctx.fillRect(10, 10, 100, 100);