Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!i7g2000prf.googlegroups.com!not-for-mail
From: ImageAnalyst <imageanalyst@mailinator.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: custom color map
Date: Sat, 9 Feb 2008 06:13:29 -0800 (PST)
Organization: http://groups.google.com
Lines: 84
Message-ID: <e2757e42-5e55-4578-8468-4dd1756c66c6@i7g2000prf.googlegroups.com>
References: <fodjtc$hcn$1@fred.mathworks.com> <70f57474-2aa9-456e-bbd4-9f7a8dfbeb49@d70g2000hsb.googlegroups.com> 
NNTP-Posting-Host: 75.186.67.199
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1202566409 20662 127.0.0.1 (9 Feb 2008 14:13:29 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 9 Feb 2008 14:13:29 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: i7g2000prf.googlegroups.com; posting-host=75.186.67.199; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 
Xref: news.mathworks.com comp.soft-sys.matlab:450327



On Feb 6, 10:16=A0pm, "David Doria" <daviddo...@gmail.com> wrote:
> Perfect! I just fix S and V and increment H, then convert
> the hsv to rgb and get exactly the effect I was going for.
> I suppose that you just have to be careful and not go
> completely around the cone because then your high values
> will be red just like the low values! =A0Is there a commonly
> used min and max angle to use on the hsv cone?
>
> Thanks for the help!
>
> Dave
>
> ImageAnalyst <imageanal...@mailinator.com> wrote in message
>
> <70f57474-2aa9-456e-bbd4-9f7a8dfbe...@d70g2000hsb.googlegroups.com>...
>
>
>
> > On Feb 6, 7:38=3DA0pm, "David Doria" <daviddo...@gmail.com>
> wrote:
> > > Is there a way to interpolate between RGB values? I have a
> > > set of values that I want to map (linearly or otherwise) to
> > > colors from a color_min to color_max. =3DA0Since RGB is not
> > > "incrementable", how would I do this?
>
> > > I'd like to actually write the function instead of using
> > > some kind of built in thing because this code is most likely
> > > going to be ported to c++ at some point.
>
> > > Any suggestions would be great!
>
> > > Thanks,
>
> > > David
>
> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3=
D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=AD=3D
>
>
>
> > =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=
=3D3D=3D3D=3D3D
> > David:
> > Yes, you can interpolate in RGB space if you want. =A0It
> depends on what
> > you want to do. =A0You could just define certain node colors
> (say, 5 of
> > them to define a path through the space), and then
> interpolate the in-
> > between values. =A0There's nothing to say that interpolation
> in RGB-
> > space is an inherently "wrong" approach.
>
> > However, you might find that using a different color space
> would be
> > easier and give a more natural progression of the colors. =A0For
> > example, define your path in HSV space (say keeping the same
> > saturation and just changing the hue), and then converting
> the values
> > back to RGB space which is what colormap in MATLAB
> requires. =A0Or
> > define a constant hue and just change the saturation values.
>
> > Seehttp://www.easyrgb.com/math.htmlfor more info plus
> lots of
> > useful, yet simple, equations. =A0There is also a newsgroup
> called
> > "sci.engr.color" if you're interested.
> > Regards,
> > ImageAnalyst- Hide quoted text -
>
> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
For hue-only variation, I guess that it's fairly common to have the
low values be blue, then higher values be green, then on through
yellow and orange and ending up with read as the highest values.
Sometimes they go on to interpolate in-between red and white so that
white has the highest values.
Regards,
ImageAnalyst