Skip to main content
.NET Framework Class Library
Brushes Class

Implements a set of predefined SolidColorBrush objects.

Inheritance Hierarchy
SystemObject
  System.Windows.MediaBrushes

Namespace:   System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Syntax
Public NotInheritable Class Brushes
public sealed class Brushes
public ref class Brushes sealed
[<[%$TOPIC/ms634884_en-us_VS_110_3_0_3_0_0%]>]
type Brushes =  class end

You cannot declare this managed class in XAML, but you can use its static properties to assign values in XAML.

The Brushes type exposes the following members.

Properties
  NameDescription
Public property Static member AliceBlueGets the solid fill color that has a hexadecimal value of #FFF0F8FF.
Public property Static member AntiqueWhiteGets the solid fill color that has a hexadecimal value of #FFFAEBD7.
Public property Static member AquaGets the solid fill color that has a hexadecimal value of #FF00FFFF.
Public property Static member AquamarineGets the solid fill color that has a hexadecimal value of #FF7FFFD4.
Public property Static member AzureGets the solid fill color that has a hexadecimal value of #FFF0FFFF.
Public property Static member BeigeGets the solid fill color that has a hexadecimal value of #FFF5F5DC.
Public property Static member BisqueGets the solid fill color that has a hexadecimal value of #FFFFE4C4.
Public property Static member BlackGets the solid fill color that has a hexadecimal value of #FF000000.
Public property Static member BlanchedAlmond Gets the solid fill color that has a hexadecimal value of #FFFFEBCD.
Public property Static member BlueGets the solid fill color that has a hexadecimal value of #FF0000FF.
Public property Static member BlueVioletGets the solid fill color that has a hexadecimal value of #FF8A2BE2.
Public property Static member BrownGets the solid fill color that has a hexadecimal value of #FFA52A2A.
Public property Static member BurlyWoodGets the solid fill color that has a hexadecimal value of #FFDEB887.
Public property Static member CadetBlueGets the solid fill color that has a hexadecimal value of #FF5F9EA0.
Public property Static member ChartreuseGets the solid fill color that has a hexadecimal value of #FF7FFF00.
Public property Static member ChocolateGets the solid fill color that has a hexadecimal value of #FFD2691E.
Public property Static member CoralGets the solid fill color that has a hexadecimal value of #FFFF7F50.
Public property Static member CornflowerBlueGets the solid fill color that has a hexadecimal value of #FF6495ED.
Public property Static member CornsilkGets the solid fill color that has a hexadecimal value of #FFFFF8DC.
Public property Static member CrimsonGets the solid fill color that has a hexadecimal value of #FFDC143C.
Public property Static member CyanGets the solid fill color that has a hexadecimal value of #FF00FFFF.
Public property Static member DarkBlueGets the solid fill color that has a hexadecimal value of #FF00008B.
Public property Static member DarkCyanGets the solid fill color that has a hexadecimal value of #FF008B8B.
Public property Static member DarkGoldenrodGets the solid fill color that has a hexadecimal value of #FFB8860B.
Public property Static member DarkGrayGets the solid fill color that has a hexadecimal value of #FFA9A9A9.
Public property Static member DarkGreenGets the solid fill color that has a hexadecimal value of #FF006400.
Public property Static member DarkKhakiGets the solid fill color that has a hexadecimal value of #FFBDB76B.
Public property Static member DarkMagentaGets the solid fill color that has a hexadecimal value of #FF8B008B.
Public property Static member DarkOliveGreenGets the solid fill color that has a hexadecimal value of #FF556B2F.
Public property Static member DarkOrangeGets the solid fill color that has a hexadecimal value of #FFFF8C00.
Public property Static member DarkOrchidGets the solid fill color that has a hexadecimal value of #FF9932CC.
Public property Static member DarkRedGets the solid fill color that has a hexadecimal value of #FF8B0000.
Public property Static member DarkSalmonGets the solid fill color that has a hexadecimal value of #FFE9967A.
Public property Static member DarkSeaGreenGets the solid fill color that has a hexadecimal value of #FF8FBC8F.
Public property Static member DarkSlateBlueGets the solid fill color that has a hexadecimal value of #FF483D8B.
Public property Static member DarkSlateGrayGets the solid fill color that has a hexadecimal value of #FF2F4F4F.
Public property Static member DarkTurquoiseGets the solid fill color that has a hexadecimal value of #FF00CED1.
Public property Static member DarkVioletGets the solid fill color that has a hexadecimal value of #FF9400D3.
Public property Static member DeepPinkGets the solid fill color that has a hexadecimal value of #FFFF1493.
Public property Static member DeepSkyBlueGets the solid fill color that has a hexadecimal value of #FF00BFFF.
Public property Static member DimGrayGets the solid fill color that has a hexadecimal value of #FF696969.
Public property Static member DodgerBlueGets the solid fill color that has a hexadecimal value of #FF1E90FF.
Public property Static member FirebrickGets the solid fill color that has a hexadecimal value of #FFB22222.
Public property Static member FloralWhiteGets the solid fill color that has a hexadecimal value of #FFFFFAF0.
Public property Static member ForestGreenGets the solid fill color that has a hexadecimal value of #FF228B22.
Public property Static member FuchsiaGets the solid fill color that has a hexadecimal value of #FFFF00FF.
Public property Static member GainsboroGets the solid fill color that has a hexadecimal value of #FFDCDCDC.
Public property Static member GhostWhiteGets the solid fill color that has a hexadecimal value of #FFF8F8FF.
Public property Static member GoldGets the solid fill color that has a hexadecimal value of #FFFFD700.
Public property Static member GoldenrodGets the solid fill color that has a hexadecimal value of #FFDAA520.
Public property Static member GrayGets the solid fill color that has a hexadecimal value of #FF808080.
Public property Static member GreenGets the solid fill color that has a hexadecimal value of #FF008000.
Public property Static member GreenYellowGets the solid fill color that has a hexadecimal value of #FFADFF2F.
Public property Static member HoneydewGets the solid fill color that has a hexadecimal value of #FFF0FFF0.
Public property Static member HotPinkGets the solid fill color that has a hexadecimal value of #FFFF69B4.
Public property Static member IndianRedGets the solid fill color that has a hexadecimal value of #FFCD5C5C.
Public property Static member IndigoGets the solid fill color that has a hexadecimal value of #FF4B0082.
Public property Static member IvoryGets the solid fill color that has a hexadecimal value of #FFFFFFF0.
Public property Static member KhakiGets the solid fill color that has a hexadecimal value of #FFF0E68C.
Public property Static member LavenderGets the solid fill color that has a hexadecimal value of #FFE6E6FA.
Public property Static member LavenderBlushGets the solid fill color that has a hexadecimal value of #FFFFF0F5.
Public property Static member LawnGreenGets the solid fill color that has a hexadecimal value of #FF7CFC00.
Public property Static member LemonChiffonGets the solid fill color that has a hexadecimal value of #FFFFFACD.
Public property Static member LightBlueGets the solid fill color that has a hexadecimal value of #FFADD8E6.
Public property Static member LightCoralGets the solid fill color that has a hexadecimal value of #FFF08080.
Public property Static member LightCyanGets the solid fill color that has a hexadecimal value of #FFE0FFFF.
Public property Static member LightGoldenrodYellowGets the solid fill color that has a hexadecimal value of #FFFAFAD2.
Public property Static member LightGrayGets the solid fill color that has a hexadecimal value of #FFD3D3D3.
Public property Static member LightGreenGets the solid fill color that has a hexadecimal value of #FF90EE90.
Public property Static member LightPinkGets the solid fill color that has a hexadecimal value of #FFFFB6C1.
Public property Static member LightSalmonGets the solid fill color that has a hexadecimal value of #FFFFA07A.
Public property Static member LightSeaGreenGets the solid fill color that has a hexadecimal value of #FF20B2AA.
Public property Static member LightSkyBlueGets the solid fill color that has a hexadecimal value of #FF87CEFA.
Public property Static member LightSlateGrayGets the solid fill color that has a hexadecimal value of #FF778899.
Public property Static member LightSteelBlueGets the solid fill color that has a hexadecimal value of #FFB0C4DE.
Public property Static member LightYellowGets the solid fill color that has a hexadecimal value of #FFFFFFE0.
Public property Static member LimeGets the solid fill color that has a hexadecimal value of #FF00FF00.
Public property Static member LimeGreenGets the solid fill color that has a hexadecimal value of #FF32CD32.
Public property Static member LinenGets the solid fill color that has a hexadecimal value of #FFFAF0E6.
Public property Static member MagentaGets the solid fill color that has a hexadecimal value of #FFFF00FF.
Public property Static member MaroonGets the solid fill color that has a hexadecimal value of #FF800000.
Public property Static member MediumAquamarineGets the solid fill color that has a hexadecimal value of #FF66CDAA.
Public property Static member MediumBlueGets the solid fill color that has a hexadecimal value of #FF0000CD.
Public property Static member MediumOrchidGets the solid fill color that has a hexadecimal value of #FFBA55D3.
Public property Static member MediumPurpleGets the solid fill color that has a hexadecimal value of #FF9370DB.
Public property Static member MediumSeaGreenGets the solid fill color that has a hexadecimal value of #FF3CB371.
Public property Static member MediumSlateBlueGets the solid fill color that has a hexadecimal value of #FF7B68EE.
Public property Static member MediumSpringGreenGets the solid fill color that has a hexadecimal value of #FF00FA9A.
Public property Static member MediumTurquoiseGets the solid fill color that has a hexadecimal value of #FF48D1CC.
Public property Static member MediumVioletRedGets the solid fill color that has a hexadecimal value of #FFC71585.
Public property Static member MidnightBlueGets the solid fill color that has a hexadecimal value of #FF191970.
Public property Static member MintCreamGets the solid fill color that has a hexadecimal value of #FFF5FFFA.
Public property Static member MistyRoseGets the solid fill color that has a hexadecimal value of #FFFFE4E1.
Public property Static member MoccasinGets the solid fill color that has a hexadecimal value of #FFFFE4B5.
Public property Static member NavajoWhiteGets the solid fill color that has a hexadecimal value of #FFFFDEAD.
Public property Static member NavyGets the solid fill color that has a hexadecimal value of #FF000080.
Public property Static member OldLaceGets the solid fill color that has a hexadecimal value of #FFFDF5E6.
Public property Static member OliveGets the solid fill color that has a hexadecimal value of #FF808000.
Public property Static member OliveDrabGets the solid fill color that has a hexadecimal value of #FF6B8E23.
Public property Static member OrangeGets the solid fill color that has a hexadecimal value of #FFFFA500.
Public property Static member OrangeRedGets the solid fill color that has a hexadecimal value of #FFFF4500.
Public property Static member OrchidGets the solid fill color that has a hexadecimal value of #FFDA70D6.
Public property Static member PaleGoldenrodGets the solid fill color that has a hexadecimal value of #FFEEE8AA.
Public property Static member PaleGreenGets the solid fill color that has a hexadecimal value of #FF98FB98.
Public property Static member PaleTurquoiseGets the solid fill color that has a hexadecimal value of #FFAFEEEE.
Public property Static member PaleVioletRedGets the solid fill color that has a hexadecimal value of #FFDB7093.
Public property Static member PapayaWhipGets the solid fill color that has a hexadecimal value of #FFFFEFD5.
Public property Static member PeachPuffGets the solid fill color that has a hexadecimal value of #FFFFDAB9.
Public property Static member PeruGets the solid fill color that has a hexadecimal value of #FFCD853F.
Public property Static member PinkGets the solid fill color that has a hexadecimal value of #FFFFC0CB.
Public property Static member PlumGets the solid fill color that has a hexadecimal value of #FFDDA0DD.
Public property Static member PowderBlueGets the solid fill color that has a hexadecimal value of #FFB0E0E6.
Public property Static member PurpleGets the solid fill color that has a hexadecimal value of #FF800080.
Public property Static member RedGets the solid fill color that has a hexadecimal value of #FFFF0000.
Public property Static member RosyBrownGets the solid fill color that has a hexadecimal value of #FFBC8F8F.
Public property Static member RoyalBlueGets the solid fill color that has a hexadecimal value of #FF4169E1.
Public property Static member SaddleBrownGets the solid fill color that has a hexadecimal value of #FF8B4513.
Public property Static member SalmonGets the solid fill color that has a hexadecimal value of #FFFA8072.
Public property Static member SandyBrownGets the solid fill color that has a hexadecimal value of #FFF4A460.
Public property Static member SeaGreenGets the solid fill color that has a hexadecimal value of #FF2E8B57.
Public property Static member SeaShellGets the solid fill color that has a hexadecimal value of #FFFFF5EE.
Public property Static member SiennaGets the solid fill color that has a hexadecimal value of #FFA0522D.
Public property Static member SilverGets the solid fill color that has a hexadecimal value of #FFC0C0C0.
Public property Static member SkyBlueGets the solid fill color that has a hexadecimal value of #FF87CEEB.
Public property Static member SlateBlueGets the solid fill color that has a hexadecimal value of #FF6A5ACD.
Public property Static member SlateGrayGets the solid fill color that has a hexadecimal value of #FF708090.
Public property Static member SnowGets the solid fill color that has a hexadecimal value of #FFFFFAFA.
Public property Static member SpringGreenGets the solid fill color that has a hexadecimal value of #FF00FF7F.
Public property Static member SteelBlueGets the solid fill color that has a hexadecimal value of #FF4682B4.
Public property Static member TanGets the solid fill color that has a hexadecimal value of #FFD2B48C.
Public property Static member TealGets the solid fill color that has a hexadecimal value of #FF008080.
Public property Static member ThistleGets the solid fill color that has a hexadecimal value of #FFD8BFD8.
Public property Static member TomatoGets the solid fill color that has a hexadecimal value of #FFFF6347.
Public property Static member TransparentGets the solid fill color that has a hexadecimal value of #00FFFFFF.
Public property Static member TurquoiseGets the solid fill color that has a hexadecimal value of #FF40E0D0.
Public property Static member VioletGets the solid fill color that has a hexadecimal value of #FFEE82EE.
Public property Static member WheatGets the solid fill color that has a hexadecimal value of #FFF5DEB3.
Public property Static member WhiteGets the solid fill color that has a hexadecimal value of #FFFFFFFF.
Public property Static member WhiteSmokeGets the solid fill color that has a hexadecimal value of #FFF5F5F5.
Public property Static member YellowGets the solid fill color that has a hexadecimal value of #FFFFFF00.
Public property Static member YellowGreenGets the solid fill color that has a hexadecimal value of #FF9ACD32.
Top
Methods
  NameDescription
Public method Equals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method GetHashCodeServes as the default hash function. (Inherited from Object.)
Public method GetTypeGets the Type of the current instance. (Inherited from Object.)
Public method ToStringReturns a string that represents the current object. (Inherited from Object.)
Top
Remarks

Color names in Windows Presentation Foundation (WPF) match the color names in Microsoft .NET Framework, Windows Forms, and Microsoft Internet Explorer. These colors and their names are based on the UNIX X11 color values.

The following image shows the color of each predefined brush, its name, and its hexadecimal value.

Color table including a color swatch, the color name, and the hexadecimal value

Predefined colors

See the Brush class for a variety of other, more complex, ways that you can paint an area. For example, try using gradients ( LinearGradientBrush, RadialGradientBrush) or images ( ImageBrush).

Examples

To paint an area with a solid color, you can use a predefined system brush, such as Red or Blue, or you can create a new SolidColorBrush and describe its Color using alpha, red, green, and blue values. In XAML, you may also paint an area with a solid color by using hexidecimal notation.

The following examples uses each of these techniques to paint a Rectangle blue.

Using a Predefined Brush

In the following example uses the predefined brush Blue to paint a rectangle blue.

<Rectangle Width="50" Height="50" Fill="Blue" />
			' Create a rectangle and paint it with
			' a predefined brush.
			Dim myPredefinedBrushRectangle As New Rectangle()
			myPredefinedBrushRectangle.Width = 50
			myPredefinedBrushRectangle.Height = 50
			myPredefinedBrushRectangle.Fill = Brushes.Blue
// Create a rectangle and paint it with 
// a predefined brush.
Rectangle myPredefinedBrushRectangle = new Rectangle();
myPredefinedBrushRectangle.Width = 50;
myPredefinedBrushRectangle.Height = 50;
myPredefinedBrushRectangle.Fill = Brushes.Blue;

Using Hexadecimal Notation

The next example uses 8-digit hexadecimal notation to paint a rectangle blue.

<!-- Note that the first two characters "FF" of the 8-digit
     value is the alpha which controls the transparency of 
     the color. Therefore, to make a completely transparent
     color (invisible), use "00" for those digits (e.g. #000000FF). -->
<Rectangle Width="50" Height="50" Fill="#FF0000FF" />

Using ARGB Values

The next example creates a SolidColorBrush and describes its Color using the ARGB values for the color blue.

<Rectangle Width="50" Height="50">
  <Rectangle.Fill>
    <SolidColorBrush>
     <SolidColorBrush.Color>

        <!-- Describes the brush's color using
             RGB values. Each value has a range of 0-255.  
             R is for red, G is for green, and B is for blue.
             A is for alpha which controls transparency of the
             color. Therefore, to make a completely transparent
             color (invisible), use a value of 0 for Alpha. -->
        <Color A="255" R="0" G="0" B="255" />
     </SolidColorBrush.Color>
    </SolidColorBrush>
  </Rectangle.Fill>
</Rectangle>
			Dim myRgbRectangle As New Rectangle()
			myRgbRectangle.Width = 50
			myRgbRectangle.Height = 50
			Dim mySolidColorBrush As New SolidColorBrush()

			' Describes the brush's color using RGB values. 
			' Each value has a range of 0-255.
			mySolidColorBrush.Color = Color.FromArgb(255, 0, 0, 255)
			myRgbRectangle.Fill = mySolidColorBrush
Rectangle myRgbRectangle = new Rectangle();
myRgbRectangle.Width = 50;
myRgbRectangle.Height = 50;
SolidColorBrush mySolidColorBrush = new SolidColorBrush();

// Describes the brush's color using RGB values.  
// Each value has a range of 0-255.
mySolidColorBrush.Color = Color.FromArgb(255, 0, 0, 255);
myRgbRectangle.Fill = mySolidColorBrush;           

For other ways of describing color, see the Color structure.

Related Topics

For more information about SolidColorBrush and additional examples, see the Painting with Solid Colors and Gradients Overview overview.

This code example is part of a larger example provided for the SolidColorBrush class. For the complete sample, see the Brushes Sample.

Version Information

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Platforms

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.