This project has moved. For the latest updates, please go here.

render custom color theme

Topics: General Topics
Oct 21, 2006 at 6:52 AM
I develop forest thematic map, and I need in Theme define custom (constant) colors from layer attributive (feature) data, for example field "species" has thouse values and colors:
1 - brown
3 - red
4 - orange
6 - yellow
7 - green
etc... (there are about 10 species classification code and colors)

Now i use GradientTheme but my problem with colors is not solved (fixed):

SharpMap.Rendering.Thematics.GradientTheme theme;
SharpMap.Styles.VectorStyle min = new SharpMap.Styles.VectorStyle();
SharpMap.Styles.VectorStyle max = new SharpMap.Styles.VectorStyle();

theme = new SharpMap.Rendering.Thematics.GradientTheme(field, 1, 10, min, max);
//theme.FillColorBlend = SharpMap.Rendering.Thematics.ColorBlend.TwoColors(Color.Green, Color.Brown);
theme.FillColorBlend = SharpMap.Rendering.Thematics.ColorBlend.ThreeColors(Color.Green, Color.Yellow, Color.Brown);

Please help me and put there any example, for theme custom color...

Thank you!
Oct 22, 2006 at 9:16 PM

You should use a styling delegate for your case.
Please look at CustomTheme.