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
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
_______________________________________________
mapguide-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Reply via email to