Master programming syntax, solve interactive challenges & run live code in Syntaxis Explore Arena →
menu_book Course Curriculum (HTML Canvas) expand_more
HTML Canvas / Styling

globalAlpha

Learn globalAlpha in HTML Canvas with a focused explanation, a topic-specific example, edge guidance, and a mastery check.

12 min read • Beginner
canvas-029.js
js
const canvas=document.querySelector("canvas");
const ctx=canvas.getContext("2d");
ctx.fillStyle="blue";ctx.fillRect(20,20,90,70);ctx.globalAlpha=.45;ctx.fillStyle="red";ctx.fillRect(70,45,90,70);
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content