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 & HelpPrograms › Draw colors with ints
Page Index Toggle Pages: 1
Draw colors with ints (Read 690 times)
Draw colors with ints
Apr 6th, 2010, 9:18am
 
Hello all!

I'm trying to use colors but I need to use integers and not the color type.

So far I only managed shades of grey. How do I do for color?
Re: Draw colors with ints
Reply #1 - Apr 6th, 2010, 10:16am
 
did you realize that you can use 3 values RGB or HSB to create color ?

there are different ways to use commands like fill or stroke

fill(gray)
fill(gray, alpha)
fill(value1, value2, value3)
fill(value1, value2, value3, alpha)
fill(color)
fill(color, alpha)
fill(hex)
fill(hex, alpha)

if that wasnt exactly what you asked for please make an example and describe your problem.
Re: Draw colors with ints
Reply #2 - Apr 6th, 2010, 10:52am
 
that was it thanks! I'll try it out  Cool
Re: Draw colors with ints
Reply #3 - Apr 7th, 2010, 12:15am
 
Cedric wrote on Apr 6th, 2010, 10:16am:
fill(gray)
fill(gray, alpha)
fill(color)
fill(color, alpha)


These ambiguous method signatures suck.

I think the 'gray' options should perhaps be removed - and as a happy side-effect it might inject some more colour into the world!

-spxl
Re: Draw colors with ints
Reply #4 - Apr 8th, 2010, 5:16pm
 
Quote:
I think the 'gray' options should perhaps be removed


Nooo come on! gray values are one of the best things that exist in the computing world!  Grin
Page Index Toggle Pages: 1