O'Reilly logo

Sams Teach Yourself WPF in 24 Hours by Christopher Bennage, Rob Eisenberg

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

Chapter 19. Colors and Brushes

What You’ll Learn in This Hour:

  • Defining colors

  • Defining brushes

  • Different types of brushes

  • Using colors and brushes

Colors and brushes are at the core of WPF. You can find them in almost every part of the API. Thus far, we have been glossing over them, allowing you to understand them on a mostly intuitive level. However, we now examine them more fully to take further advantage of WPF’s powerful features.

Using Colors

We’ve been using colors from the very beginning of this book, but we first drew attention to them in Hour 14, “Resources and Styles,” when we introduced resources. Here’s what we showed:

<Color x:Key="lightBlueColor">#FF145E9D</Color>
<Color x:Key="darkBlueColor">#FF022D51</Color>
<Color x:Key="redColor">

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