problem with transparency
in
Programming Questions
•
2 years ago
Hi, I have a little question. I want that the yellow lines are half transparent in my pattern generator, but at the moment they are only transparent in the lower range. Where could be my error? Thanks for any answer or help
Code:
void setup(){
size(500,500);
}
void draw(){
background(255,255,255);
randomSeed(mouseX);
int wert1 = 20;
int wert2 = 20;
for(int i = 0; i<wert1; i++){
for(int j = 0; j<wert1; j++){
redlines(0, height/wert1*i, 500, mouseY/wert2, j*25, 0, j*25);
bluelines(0, height/wert2*i, 500, mouseY/wert1, j*25, 0, j*25);
yellowlines(width/wert2*j, 0, mouseY/wert1, 500, j*25, 0, j*25, 100);
}
}
}
void redlines (float x, float y, float breite, float hoehe, float rot, float gruen, float blau){
noStroke();
fill(255,105,105);
rect(x,y,breite,hoehe+15);
}
void bluelines (float x, float y, float breite, float hoehe, float rot, float gruen, float blau){
fill(105,105,252);
rect(x,y+5,breite,hoehe+5);
}
void yellowlines (float x, float y, float weite, float breite, float rot, float gruen, float blau, float trans){
noStroke();
fill(252,234,105, trans);
rect(x,y,weite+12,breite);
}
Code:
void setup(){
size(500,500);
}
void draw(){
background(255,255,255);
randomSeed(mouseX);
int wert1 = 20;
int wert2 = 20;
for(int i = 0; i<wert1; i++){
for(int j = 0; j<wert1; j++){
redlines(0, height/wert1*i, 500, mouseY/wert2, j*25, 0, j*25);
bluelines(0, height/wert2*i, 500, mouseY/wert1, j*25, 0, j*25);
yellowlines(width/wert2*j, 0, mouseY/wert1, 500, j*25, 0, j*25, 100);
}
}
}
void redlines (float x, float y, float breite, float hoehe, float rot, float gruen, float blau){
noStroke();
fill(255,105,105);
rect(x,y,breite,hoehe+15);
}
void bluelines (float x, float y, float breite, float hoehe, float rot, float gruen, float blau){
fill(105,105,252);
rect(x,y+5,breite,hoehe+5);
}
void yellowlines (float x, float y, float weite, float breite, float rot, float gruen, float blau, float trans){
noStroke();
fill(252,234,105, trans);
rect(x,y,weite+12,breite);
}
1