Brushes
You can fill in the color of any number of controls using a brush. The easiest place to see this in action is with a BoxView
control, or with Frame
.
There are three types of brushes, Solid, Linear Gradient, and Radial Gradient. Let’s explore them in a bit more detail.
The Solid brush
The Solid Brush is used when you want to fill a control with a single color. Typically, the solid brush is implicit in the BackgroundColor
property of the control, as we saw above when drawing the BoxView
control.
LinearGradientBrush
LinearGradientBrush
paints an area with a blend of two or more colors along a line called the gradient axis. You specify a start point and an endpoint, and then you specify stop points (where the colors switch) along the way.
The start and endpoints are relative to the borders of the painted area, with 0,0
being the upper left corner (and the default start) and 1,1
being the lower right (and the default stop).
To illustrate this, I’...