|
Author |
Topic: *beware newbie* why the color() is not working? (Read 331 times) |
|
lunetta
|
*beware newbie* why the color() is not working?
« on: Mar 21st, 2004, 10:38pm » |
|
Hi I have a really dumb question; Why this does not work? color test = color(204, 50, 50); void setup() { size (200,200); } void loop() { fill (test); rect (0,0,100,100); } sorry for bothering with this extremely simple thing... if the color is a primitive datatype, why can't a declare a global assigning a RGB value? the hex notation works... Thanks!
|
|
|
|
fry
|
Re: *beware newbie* why the color() is not working
« Reply #1 on: Mar 21st, 2004, 10:58pm » |
|
because color() is a function, and it's dependent on the current colorMode(), and the colorMode() is not set until you're inside of setup(). but as you point out, this is a real nuisance, so i think i'll modify it to work as you have it in your program, just with colorMode(RGB, 255) since that's what most people are using. sorry for the confusion..
|
|
|
|
lunetta
|
Re: *beware newbie* why the color() is not working
« Reply #2 on: Mar 22nd, 2004, 6:17am » |
|
Thanks!!
|
|
|
|
|