[mapguide-users] Theme layer application - degraded color

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Tue Jan 13 09:01:09 EST 2009


A simple approach would be to calculate the number of increments (ea 
number of colors).
Then for each R,G,B component of the start and end color, calculate the 
difference, and divide by number of increments.
With this information you can construct each of the desired colors.
Example:
Start color: 200,100,50
End color: 50, 200, 100
Steps: 10
Increments: (200-50)/10=-15, (100-200)/10=10,(50-100)/10=-5

Color x: 200 + (-15 * x), 100 + (10 * x), 50 + (-5 * x)

Rounding and other annoying stuff obviously plays in, and needs to be 
handled.

A more elegant approach would be to use the ColorBrewer system:
http://www.personal.psu.edu/cab38/ColorBrewer/ColorBrewer_intro.html

This system takes into account the type of data you are trying to visualize.

Regards, Kenneth Skovhede, GEOGRAF A/S



Arnaud De Groof skrev:
>
> Hi,
>
>  
>
> I use the theme layer application (PHP) and I would like apply a 
> degraded color to the layer according the value. Currently, when I use 
> this application the color is given randomly. Could you explain me the 
> process to obtain a degraded color with this function?
>
>  
>
> Thanks,
>
>  
>
> Arnaud De Groof
>
>  
>
> *
> ------------------------------------------------------------------------
> E-MAIL DISCLAIMER*
>
> The present message may contain confidential and/or legally privileged 
> information. If you are not the intended addressee and in case of a 
> transmission error, please notify the sender immediately and destroy 
> this E-mail. Disclosure, reproduction or distribution of this document 
> and its possible attachments is strictly forbidden.
>
> SPACEBEL denies all liability for incomplete, improper, inaccurate, 
> intercepted, (partly) destroyed, lost and/or belated transmission of 
> the current information given that unencrypted electronic transmission 
> cannot currently be guaranteed to be secure or error free.
> Upon request or in conformity with formal, contractual agreements, an 
> originally signed hard copy will be sent to you to confirm the 
> information contained in this E-mail.
>
> SPACEBEL denies all liability where E-mail is used for private use.
>
> SPACEBEL cannot be held responsible for possible viruses that might 
> corrupt this message and/or your computer system.
>
> ------------------------------------------------------------------------
> ------------------------------------------------------------------------
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20090113/3630728d/attachment.html


More information about the mapguide-users mailing list