O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Color Brushes

The three color brushes are SolidColorBrush, LinearGradientBrush, and RadialGradientBrush. The last one is WPF- and Silverlight-specific. These brushes sound straightforward, but they 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 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required