<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/163298</link>
    <title>MATLAB Central Newsreader - custom color map</title>
    <description>Feed for thread: custom color map</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 07 Feb 2008 00:38:04 -0500</pubDate>
      <title>custom color map</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/163298#413432</link>
      <author>David Doria</author>
      <description>Is there a way to interpolate between RGB values? I have a&lt;br&gt;
set of values that I want to map (linearly or otherwise) to&lt;br&gt;
colors from a color_min to color_max.  Since RGB is not&lt;br&gt;
&quot;incrementable&quot;, how would I do this?&lt;br&gt;
&lt;br&gt;
I'd like to actually write the function instead of using&lt;br&gt;
some kind of built in thing because this code is most likely&lt;br&gt;
going to be ported to c++ at some point.&lt;br&gt;
&lt;br&gt;
Any suggestions would be great!&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
&lt;br&gt;
David</description>
    </item>
    <item>
      <pubDate>Thu, 07 Feb 2008 01:06:33 -0500</pubDate>
      <title>Re: custom color map</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/163298#413435</link>
      <author>ImageAnalyst</author>
      <description>On Feb 6, 7:38=A0pm, &quot;David Doria&quot; &amp;lt;daviddo...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Is there a way to interpolate between RGB values? I have a&lt;br&gt;
&amp;gt; set of values that I want to map (linearly or otherwise) to&lt;br&gt;
&amp;gt; colors from a color_min to color_max. =A0Since RGB is not&lt;br&gt;
&amp;gt; &quot;incrementable&quot;, how would I do this?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I'd like to actually write the function instead of using&lt;br&gt;
&amp;gt; some kind of built in thing because this code is most likely&lt;br&gt;
&amp;gt; going to be ported to c++ at some point.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Any suggestions would be great!&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thanks,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; David&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
=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=&lt;br&gt;
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D&lt;br&gt;
David:&lt;br&gt;
Yes, you can interpolate in RGB space if you want.  It depends on what&lt;br&gt;
you want to do.  You could just define certain node colors (say, 5 of&lt;br&gt;
them to define a path through the space), and then interpolate the in-&lt;br&gt;
between values.  There's nothing to say that interpolation in RGB-&lt;br&gt;
space is an inherently &quot;wrong&quot; approach.&lt;br&gt;
&lt;br&gt;
However, you might find that using a different color space would be&lt;br&gt;
easier and give a more natural progression of the colors.  For&lt;br&gt;
example, define your path in HSV space (say keeping the same&lt;br&gt;
saturation and just changing the hue), and then converting the values&lt;br&gt;
back to RGB space which is what colormap in MATLAB requires.  Or&lt;br&gt;
define a constant hue and just change the saturation values.&lt;br&gt;
&lt;br&gt;
See &lt;a href=&quot;http://www.easyrgb.com/math.html&quot;&gt;http://www.easyrgb.com/math.html&lt;/a&gt; for more info plus lots of&lt;br&gt;
useful, yet simple, equations.  There is also a newsgroup called&lt;br&gt;
&quot;sci.engr.color&quot; if you're interested.&lt;br&gt;
Regards,&lt;br&gt;
ImageAnalyst</description>
    </item>
    <item>
      <pubDate>Thu, 07 Feb 2008 03:16:03 -0500</pubDate>
      <title>Re: custom color map</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/163298#413452</link>
      <author>David Doria</author>
      <description>Perfect! I just fix S and V and increment H, then convert&lt;br&gt;
the hsv to rgb and get exactly the effect I was going for. &lt;br&gt;
I suppose that you just have to be careful and not go&lt;br&gt;
completely around the cone because then your high values&lt;br&gt;
will be red just like the low values!  Is there a commonly&lt;br&gt;
used min and max angle to use on the hsv cone?&lt;br&gt;
&lt;br&gt;
Thanks for the help!&lt;br&gt;
&lt;br&gt;
Dave&lt;br&gt;
&lt;br&gt;
ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;70f57474-2aa9-456e-bbd4-9f7a8dfbeb49@d70g2000hsb.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On Feb 6, 7:38=A0pm, &quot;David Doria&quot; &amp;lt;daviddo...@gmail.com&amp;gt;&lt;br&gt;
wrote:&lt;br&gt;
&amp;gt; &amp;gt; Is there a way to interpolate between RGB values? I have a&lt;br&gt;
&amp;gt; &amp;gt; set of values that I want to map (linearly or otherwise) to&lt;br&gt;
&amp;gt; &amp;gt; colors from a color_min to color_max. =A0Since RGB is not&lt;br&gt;
&amp;gt; &amp;gt; &quot;incrementable&quot;, how would I do this?&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I'd like to actually write the function instead of using&lt;br&gt;
&amp;gt; &amp;gt; some kind of built in thing because this code is most likely&lt;br&gt;
&amp;gt; &amp;gt; going to be ported to c++ at some point.&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Any suggestions would be great!&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Thanks,&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; David&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;&lt;br&gt;
=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=&lt;br&gt;
&amp;gt; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D&lt;br&gt;
&amp;gt; David:&lt;br&gt;
&amp;gt; Yes, you can interpolate in RGB space if you want.  It&lt;br&gt;
depends on what&lt;br&gt;
&amp;gt; you want to do.  You could just define certain node colors&lt;br&gt;
(say, 5 of&lt;br&gt;
&amp;gt; them to define a path through the space), and then&lt;br&gt;
interpolate the in-&lt;br&gt;
&amp;gt; between values.  There's nothing to say that interpolation&lt;br&gt;
in RGB-&lt;br&gt;
&amp;gt; space is an inherently &quot;wrong&quot; approach.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; However, you might find that using a different color space&lt;br&gt;
would be&lt;br&gt;
&amp;gt; easier and give a more natural progression of the colors.  For&lt;br&gt;
&amp;gt; example, define your path in HSV space (say keeping the same&lt;br&gt;
&amp;gt; saturation and just changing the hue), and then converting&lt;br&gt;
the values&lt;br&gt;
&amp;gt; back to RGB space which is what colormap in MATLAB&lt;br&gt;
requires.  Or&lt;br&gt;
&amp;gt; define a constant hue and just change the saturation values.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; See &lt;a href=&quot;http://www.easyrgb.com/math.html&quot;&gt;http://www.easyrgb.com/math.html&lt;/a&gt; for more info plus&lt;br&gt;
lots of&lt;br&gt;
&amp;gt; useful, yet simple, equations.  There is also a newsgroup&lt;br&gt;
called&lt;br&gt;
&amp;gt; &quot;sci.engr.color&quot; if you're interested.&lt;br&gt;
&amp;gt; Regards,&lt;br&gt;
&amp;gt; ImageAnalyst</description>
    </item>
    <item>
      <pubDate>Sat, 09 Feb 2008 14:13:29 -0500</pubDate>
      <title>Re: custom color map</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/163298#413994</link>
      <author>ImageAnalyst</author>
      <description>On Feb 6, 10:16=A0pm, &quot;David Doria&quot; &amp;lt;daviddo...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Perfect! I just fix S and V and increment H, then convert&lt;br&gt;
&amp;gt; the hsv to rgb and get exactly the effect I was going for.&lt;br&gt;
&amp;gt; I suppose that you just have to be careful and not go&lt;br&gt;
&amp;gt; completely around the cone because then your high values&lt;br&gt;
&amp;gt; will be red just like the low values! =A0Is there a commonly&lt;br&gt;
&amp;gt; used min and max angle to use on the hsv cone?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thanks for the help!&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Dave&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; ImageAnalyst &amp;lt;imageanal...@mailinator.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;lt;70f57474-2aa9-456e-bbd4-9f7a8dfbe...@d70g2000hsb.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; On Feb 6, 7:38=3DA0pm, &quot;David Doria&quot; &amp;lt;daviddo...@gmail.com&amp;gt;&lt;br&gt;
&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Is there a way to interpolate between RGB values? I have a&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; set of values that I want to map (linearly or otherwise) to&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; colors from a color_min to color_max. =3DA0Since RGB is not&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &quot;incrementable&quot;, how would I do this?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I'd like to actually write the function instead of using&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; some kind of built in thing because this code is most likely&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; going to be ported to c++ at some point.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Any suggestions would be great!&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Thanks,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; David&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3=&lt;br&gt;
D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=AD=3D&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=&lt;br&gt;
=3D3D=3D3D=3D3D&lt;br&gt;
&amp;gt; &amp;gt; David:&lt;br&gt;
&amp;gt; &amp;gt; Yes, you can interpolate in RGB space if you want. =A0It&lt;br&gt;
&amp;gt; depends on what&lt;br&gt;
&amp;gt; &amp;gt; you want to do. =A0You could just define certain node colors&lt;br&gt;
&amp;gt; (say, 5 of&lt;br&gt;
&amp;gt; &amp;gt; them to define a path through the space), and then&lt;br&gt;
&amp;gt; interpolate the in-&lt;br&gt;
&amp;gt; &amp;gt; between values. =A0There's nothing to say that interpolation&lt;br&gt;
&amp;gt; in RGB-&lt;br&gt;
&amp;gt; &amp;gt; space is an inherently &quot;wrong&quot; approach.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; However, you might find that using a different color space&lt;br&gt;
&amp;gt; would be&lt;br&gt;
&amp;gt; &amp;gt; easier and give a more natural progression of the colors. =A0For&lt;br&gt;
&amp;gt; &amp;gt; example, define your path in HSV space (say keeping the same&lt;br&gt;
&amp;gt; &amp;gt; saturation and just changing the hue), and then converting&lt;br&gt;
&amp;gt; the values&lt;br&gt;
&amp;gt; &amp;gt; back to RGB space which is what colormap in MATLAB&lt;br&gt;
&amp;gt; requires. =A0Or&lt;br&gt;
&amp;gt; &amp;gt; define a constant hue and just change the saturation values.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; See&lt;a href=&quot;http://www.easyrgb.com/math.htmlfor&quot;&gt;http://www.easyrgb.com/math.htmlfor&lt;/a&gt; more info plus&lt;br&gt;
&amp;gt; lots of&lt;br&gt;
&amp;gt; &amp;gt; useful, yet simple, equations. =A0There is also a newsgroup&lt;br&gt;
&amp;gt; called&lt;br&gt;
&amp;gt; &amp;gt; &quot;sci.engr.color&quot; if you're interested.&lt;br&gt;
&amp;gt; &amp;gt; Regards,&lt;br&gt;
&amp;gt; &amp;gt; ImageAnalyst- Hide quoted text -&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; - Show quoted text -- Hide quoted text -&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; - Show quoted text -&lt;br&gt;
&lt;br&gt;
=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=&lt;br&gt;
=3D=3D=3D=3D&lt;br&gt;
For hue-only variation, I guess that it's fairly common to have the&lt;br&gt;
low values be blue, then higher values be green, then on through&lt;br&gt;
yellow and orange and ending up with read as the highest values.&lt;br&gt;
Sometimes they go on to interpolate in-between red and white so that&lt;br&gt;
white has the highest values.&lt;br&gt;
Regards,&lt;br&gt;
ImageAnalyst</description>
    </item>
  </channel>
</rss>

