FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Bugs
   Software Bugs
(Moderator: fry)
   negative alpha value in fill()
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: negative alpha value in fill()  (Read 282 times)
dlb

Email
negative alpha value in fill()
« on: Aug 2nd, 2003, 10:48am »

When there is used negative alpha value in fill(), like fill(255, 0, 0, -50); then as supposed nothing apears, but when for example I'm duplicating ellipse in the same place with let's say the same parameters, then after some time shows up black ellipses making somthing similar to cloud. I used pattern sketch by REAS to prove this. try this code when moving mouse fast in practicaly one place and be patient, it will appear after some time.
 
I'm working on windows platform with 0056.
 
Edit:
The same goes to relatively small alpha values, like 0.5, and using value 5 after long mouse moving, "cloud" was far from real red color, it was like red+gray but not pure red, as it should be if ellipse has duplicated itself in one place about 200 times.
 
Code:

int maxSpeed;
void setup()
{
  size(200, 200);
  noBackground();
  
  noStroke();
  fill(102, 102, 102);
  rect(0, 0, width, height);
  fill(255, 0, 0, -50); // notice negative alpha value here
  
  ellipseMode(CENTER_DIAMETER);
}
 
void loop()  
{
  if((pmouseX != 0) && (pmouseY != 0)) {
    variableEllipse(mouseX, mouseY, pmouseX, pmouseY);
  }
}
 
void variableEllipse(int x, int y, int px, int py)  
{
  float speed = abs(x-px) + abs(y-py);
  //stroke(speed); // I commented stroke() out, so that it's easier to see black ellipse
  ellipse(x, y, speed, speed);
}
« Last Edit: Aug 2nd, 2003, 10:57am by dlb »  
Pages: 1 

« Previous topic | Next topic »