I have the following LinearGradientBrush
var brush = new LinearGradientBrush();
brush.GradientStops.Add(new GradientStop { Color = Colors.Transparent, Offset = 0 });
brush.GradientStops.Add(new GradientStop { Color = Colors.Blue, Offset = 0.1 });
brush.GradientStops.Add(new GradientStop { Color = Colors.Cyan, Offset = 0.2 });
brush.GradientStops.Add(new GradientStop { Color = Colors.GreenYellow, Offset = 0.4 });
brush.GradientStops.Add(new GradientStop { Color = Colors.Yellow, Offset = 0.6 });
brush.GradientStops.Add(new GradientStop { Color = Colors.Red, Offset = 0.8 });
brush.GradientStops.Add(new GradientStop { Color = Colors.Magenta, Offset = 1 });
and I use the following code to set the texture coordinates
textureCoordinates.Add(new Point(z_value / 100d, 0));
The result is not bad. But as you can see in the following image the highest value is always magenta even if the z value I used for the texture coordinate is quite low:
The right example should be colored blue.
How can I set the color correctly? My z values are all between 0 and 100.