[Fwd: Re: [UMN_MAPSERVER-DEV] Re-thinking RFC 6]
Jan Hartmann
j.l.h.hartmann at UVA.NL
Fri Jun 15 09:54:01 EDT 2007
Daniel Morissette wrote:
> Jan Hartmann wrote:
>> Perhaps converting the start and end color to HSV (Hue, Saturation,
>> Value) would give values that could be interpolated in a meaningful way.
>> For display, the interpolated colors could be converted back to RGB. The
>> algorithm is elementary, i believe.
>>
>
> I don't know if interpolating on HSV is enough. Doing a quick Google
> search turned up this page:
>
> http://ozviz.wasp.uwa.edu.au/~pbourke/texture_colour/colourramp/
>
> I didn't read it, just forwarding the link... I got a few RFCs to work
> on myself today. ;)
>
> Daniel
There is a complete example with C-code for interpolating between RGB
and HSV colorspaces at
http://www.uio.no/studier/emner/matnat/ifi/INF3320/h04/undervisningsmateriale/oblig1.pdf
And here is a description on how to do interpolate in RGB and HSV in
"The Gimp", plus more complicated ways of creating gradients:
http://www.grosse.is-a-geek.com/pcplus/hd244sd/hd244.html
I don't know much about color, but my impression is that HSV
interpolating in HSV gives more natural results than in RGB, but it is
not the only possible method, and it is not appropriate on all occasions.
Jan
More information about the mapserver-dev
mailing list