💅 Sets the global opacity, which affects all subsequent drawing operations, except background. Default is 1, fully opaque.
background
In q5 WebGPU this function only affects images.
opacity level, ranging from 0 to 1
await Canvas(200);background(0.8);opacity(1);circle(-20, -20, 80);opacity(0.2);square(-20, -20, 80); Copy
await Canvas(200);background(0.8);opacity(1);circle(-20, -20, 80);opacity(0.2);square(-20, -20, 80);
💅 Sets the global opacity, which affects all subsequent drawing operations, except
background. Default is 1, fully opaque.In q5 WebGPU this function only affects images.