Color Brushes

The two color brushes are SolidColorBrush and LinearGradientBrush. They sound straightforward, but these Brushes are more flexible than most people realize.

SolidColorBrush

SolidColorBrush, used implicitly throughout this book, fills the target area with a single color. It has a simple Color property of type Windows.UI.Color. Color exposes four Byte properties (one per channel): A for alpha, R for red, G for green, and B for blue. Because of the syntax that treats strings such as “Blue” or “#FFFFFF” as SolidColorBrushes, they are indistinguishable from their underlying Color in XAML. In fact, color strings can take one of three different forms in XAML:

A name, like Red, Khaki, or DodgerBlue, matching one of the static properties ...

Get Universal Windows® Apps with XAML and C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.