hello i us background(‘rgba(0,255,0, 0.25)’) in my code,but the Alpha inoperative?
the browser is chrome (107.0.5304.88)
background(‘rgba(0,255,0, 0.25)’);
hello i us background(‘rgba(0,255,0, 0.25)’) in my code,but the Alpha inoperative?
the browser is chrome (107.0.5304.88)
background(‘rgba(0,255,0, 0.25)’);
I tested your code in Firefox and Chrome (version 107.0.5304.88 as well), and the alpha is displaying properly. Did you remember to refresh your web page after saving your sketch?
Perhaps you have a typo somewhere. Just to make sure that isn’t the issue try it with this code:
function setup() {
createCanvas(100, 100, WEBGL);
}
function draw() {
background('rgba(0, 255, 0, 0.25)');
rotateY(millis() / 1000);
noFill();
stroke(255, 204, 0);
strokeWeight(1);
sphere(40);
}
You could also check the Console
in Chrome and see if it mentions any errors. To open your console:
Inspect
Console
tab somewhere in the top