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.
Page Index Toggle Pages: 1
RGB to HEX (Read 617 times)
RGB to HEX
Jan 7th, 2007, 7:36am
 
What I want to do is get the color from the center of the app and convert the color value to a hex string like "#ff00ff" and save it to a file. How do I do this?
-Tim
Re: RGB to HEX
Reply #1 - Jan 7th, 2007, 8:25am
 
hex()
saveStrings()
http://processing.org/reference/index_ext.html

String[] s = { hex(color(45, 34, 56)), hex(color(145, 34, 56)) };
saveStrings("cols.txt", s);

Re: RGB to HEX
Reply #2 - Jan 7th, 2007, 8:51am
 
Thank you.
Page Index Toggle Pages: 1