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.
IndexProgramming Questions & HelpOther Libraries › Color changes in controlP5
Page Index Toggle Pages: 1
Color changes in controlP5 (Read 527 times)
Color changes in controlP5
Aug 27th, 2008, 8:17pm
 
I would like to change the color of active radio buttons from the default blue.  I am using the setActiveColor() method to change it. This works great, but my issue is what to supply as the color.  The method takes an integer.  Is there a way of knowing what integer value corresponds to what color?


Thanks!
Re: Color changes in controlP5
Reply #1 - Aug 27th, 2008, 11:55pm
 
I don't know controlP5 (yet) but in Processing, colors (of the type [i]color[i]) are actually plain integers...
You might want to mask the alpha channel, if not handled by controlP5, because opaque is FF, so it makes the integer negative.
Re: Color changes in controlP5
Reply #2 - Sep 23rd, 2008, 6:09pm
 
I poked around in the example code. The color(xxx,xxx,xxx) command is used to provide the integer value:

controlP5.setColorBackground(color(162,153,125));
controlP5.setColorForeground(color(204,204,0)); //Qty & rim color
controlP5.setColorValue(color(255,255,255)); // Text inside control or box
controlP5.setColorLabel(color(255,255,255));  //Text Color
controlP5.setColorActive(color(217,214,202)); //Selected items
Page Index Toggle Pages: 1