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.
IndexDiscussionGeneral Discussion,  Status › Question on Color Maps
Page Index Toggle Pages: 1
Question on Color Maps (Read 1028 times)
Question on Color Maps
Dec 21st, 2009, 1:53pm
 
Hi,

Not really sure exactly where I should be posting this, so hope this is the place...

I am working on a plotting program for rendering various escape types of fractals. All of them are 2d, and in the process of iterating them, I am keeping a 2d histogram of the plots. I would like to be able to convert these histograms into images based on different Color Maps.

What I mean by a Color Map is a table that holds color definitions that would translate the values of the histogram into RGB colors, based on the values in the histogram. This color map could be as simple as 2 colors, with intervening interpolated values, or as complex as many different colors at various points in the map, with intervening interpolated values.

My question is does this sound like something that someone has already developed? I hope my description was good enough to give an idea of what I am looking for.

Thanks.
Re: Question on Color Maps
Reply #1 - Dec 21st, 2009, 2:23pm
 
two things come to my mind to get some quick results. one would be to switch from RGB to colorMode(HSB). you can define the range to the values you get or use map() to map them.

Anotherway would be to use lerpColor() to get the range between two colors. you can maybe use some "ifs" to use 3 or more colors if needed.



Page Index Toggle Pages: 1