We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexSuggestions & BugsWebsite,  Documentation,  Book Bugs › Color Section of Tutorial by Daniel Shiffman
Page Index Toggle Pages: 1
Color Section of Tutorial by Daniel Shiffman (Read 1349 times)
Color Section of Tutorial by Daniel Shiffman
Apr 3rd, 2010, 1:26pm
 
To whom it may concern,
I am a complete newbie to this stuff but i think there may be an oversight in the "COLOR" section of the tutorials.
It's no biggie but being a newbie it took a second for me to make the corrections.
In the "Color Transparency Section" the code given is:

background(0);
noStroke();

// No fourth argument means 100% opacity.
fill(0,0,255);
rect(0,0,100,200);

// 255 means 100% opacity.
fill(255,0,0,255);
rect(0,0,200,40);

// 75% opacity.
fill(255,0,0,191);
rect(0,50,200,40);

// 55% opacity.
fill(255,0,0,127);
rect(0,100,200,40);

// 25% opacity.
fill(255,0,0,63);
rect(0,150,200,40);

To make the "Alpha Transparency" example shouldn't it be:

background(0);
noStroke();

// No fourth argument means 100% opacity.
fill(0,0,255);
rect(0,0,width/2,100);

// 255 means 100% opacity.
fill(255,0,0,255);
rect(0,0,100,20);

// 75% opacity.
fill(255,0,0,191);
rect(0,25,100,20);

// 55% opacity.
fill(255,0,0,127);
rect(0,50,100,20);

// 25% opacity.
fill(255,0,0,63);
rect(0,75,100,20);

or...

size(200,200);
background(0);
noStroke();

// No fourth argument means 100% opacity.
fill(0,0,255);
rect(0,0,100,200);

// 255 means 100% opacity.
fill(255,0,0,255);
rect(0,0,200,40);

// 75% opacity.
fill(255,0,0,191);
rect(0,50,200,40);

// 55% opacity.
fill(255,0,0,127);
rect(0,100,200,40);

// 25% opacity.
fill(255,0,0,63);
rect(0,150,200,40);

?

Re: Color Section of Tutorial by Daniel Shiffman
Reply #1 - Apr 3rd, 2010, 1:43pm
 
so what exactly did you change ?
[color=#0000ff] ???
why?
Re: Color Section of Tutorial by Daniel Shiffman
Reply #2 - Apr 4th, 2010, 6:49am
 
Whoops, yes, I left off size(200,200); by accident.  Will fix now, thanks!
Re: Color Section of Tutorial by Daniel Shiffman
Reply #3 - Apr 4th, 2010, 7:20am
 
ah size was the problem couldnt figure it out Smiley
Page Index Toggle Pages: 1