Gradients

Version: v9.x

FmgLib.MauiMarkup provides a way to create visual effects using gradient brushes in curly braces. There are two defined types of gradient brushes:

  • LinearGradientBrush
  • RadialGradientBrush.

Example

Here is an example of a Border element with a LinearGradientBrush as its background. The gradient effect goes from the top-left corner to the bottom-right corner.

new Border()
.Background(
	new LinearGradientBrush()
	.StartPoint(new Point(0,0))
	.EndPoint(new Point(1,1))
	.GradientStops(
		new List<GradientStop>(){
			new GradientStop(Colors.Yellow, 0.0),
		    new GradientStop(Colors.Red, 0.25),
		    new GradientStop(Colors.Blue, 0.75),
		    new GradientStop(Colors.LimeGreen, 1.0)
	    }
	)
)