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_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   println() and color()...
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: println() and color()...  (Read 246 times)
lunetta

7200475272004752 WWW Email
println() and color()...
« on: May 8th, 2004, 5:19pm »

hello all
 
I'm trying to understand a little the format a color() object is stored;
when I retrieve it with a println() function, it returns a value from -1 to -2^24;
 
-why the value is negative? any special reason?
-what is the formula to convert a (R, G, B) color value to this format?
 
thanks!
 
 
TomC

WWW
Re: println() and color()...
« Reply #1 on: May 8th, 2004, 7:28pm »

The Language Reference for color offers some explanation:
http://processing.org/reference/color_.html
 
Negative color values, and more, are explained by toxi and fry here:
http://processing.org/discourse/yabb/board_Syntax_action_displa_y_num_1051039820.html
 
The formula you request is provided by arielm here:
http://processing.org/discourse/yabb/board_Syntax_action_displa_y_num_1060798598.html
 
You might be interested to know that these are both filed in Technotes in the reference section - it's an invaluable resource
« Last Edit: May 8th, 2004, 7:29pm by TomC »  
lunetta

7200475272004752 WWW Email
Re: println() and color()...
« Reply #2 on: May 8th, 2004, 9:13pm »

Oh, I'm so sorry about this... It hadn't ocurred to me to read the technotes regarding color before posting... the answers are there...
 
thanks and sorry again for the time waste
 
TomC

WWW
Re: println() and color()...
« Reply #3 on: May 8th, 2004, 10:45pm »

No problem...  Keep 'em coming!
 
Pages: 1 

« Previous topic | Next topic »