1 out of 1 rated this helpful - Rate this topic

Brushes Class

Implements a set of predefined SolidColorBrush objects.

System.Object
  System.Windows.Media.Brushes

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
public sealed class Brushes
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.

  Name Description
Public property Static member AliceBlue Gets the solid fill color that has a hexadecimal value of #FFF0F8FF.
Public property Static member AntiqueWhite Gets the solid fill color that has a hexadecimal value of #FFFAEBD7.
Public property Static member Aqua Gets the solid fill color that has a hexadecimal value of #FF00FFFF.
Public property Static member Aquamarine Gets the solid fill color that has a hexadecimal value of #FF7FFFD4.
Public property Static member Azure Gets the solid fill color that has a hexadecimal value of #FFF0FFFF.
Public property Static member Beige Gets the solid fill color that has a hexadecimal value of #FFF5F5DC.
Public property Static member Bisque Gets the solid fill color that has a hexadecimal value of #FFFFE4C4.
Public property Static member Black Gets 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 Blue Gets the solid fill color that has a hexadecimal value of #FF0000FF.
Public property Static member BlueViolet Gets the solid fill color that has a hexadecimal value of #FF8A2BE2.
Public property Static member Brown Gets the solid fill color that has a hexadecimal value of #FFA52A2A.
Public property Static member BurlyWood Gets the solid fill color that has a hexadecimal value of #FFDEB887.
Public property Static member CadetBlue Gets the solid fill color that has a hexadecimal value of #FF5F9EA0.
Public property Static member Chartreuse Gets the solid fill color that has a hexadecimal value of #FF7FFF00.
Public property Static member Chocolate Gets the solid fill color that has a hexadecimal value of #FFD2691E.
Public property Static member Coral Gets the solid fill color that has a hexadecimal value of #FFFF7F50.
Public property Static member CornflowerBlue Gets the solid fill color that has a hexadecimal value of #FF6495ED.
Public property Static member Cornsilk Gets the solid fill color that has a hexadecimal value of #FFFFF8DC.
Public property Static member Crimson Gets the solid fill color that has a hexadecimal value of #FFDC143C.
Public property Static member Cyan Gets the solid fill color that has a hexadecimal value of #FF00FFFF.
Public property Static member DarkBlue Gets the solid fill color that has a hexadecimal value of #FF00008B.
Public property Static member DarkCyan Gets the solid fill color that has a hexadecimal value of #FF008B8B.
Public property Static member DarkGoldenrod Gets the solid fill color that has a hexadecimal value of #FFB8860B.
Public property Static member DarkGray Gets the solid fill color that has a hexadecimal value of #FFA9A9A9.
Public property Static member DarkGreen Gets the solid fill color that has a hexadecimal value of #FF006400.
Public property Static member DarkKhaki Gets the solid fill color that has a hexadecimal value of #FFBDB76B.
Public property Static member DarkMagenta Gets the solid fill color that has a hexadecimal value of #FF8B008B.
Public property Static member DarkOliveGreen Gets the solid fill color that has a hexadecimal value of #FF556B2F.
Public property Static member DarkOrange Gets the solid fill color that has a hexadecimal value of #FFFF8C00.
Public property Static member DarkOrchid Gets the solid fill color that has a hexadecimal value of #FF9932CC.
Public property Static member DarkRed Gets the solid fill color that has a hexadecimal value of #FF8B0000.
Public property Static member DarkSalmon Gets the solid fill color that has a hexadecimal value of #FFE9967A.
Public property Static member DarkSeaGreen Gets the solid fill color that has a hexadecimal value of #FF8FBC8F.
Public property Static member DarkSlateBlue Gets the solid fill color that has a hexadecimal value of #FF483D8B.
Public property Static member DarkSlateGray Gets the solid fill color that has a hexadecimal value of #FF2F4F4F.
Public property Static member DarkTurquoise Gets the solid fill color that has a hexadecimal value of #FF00CED1.
Public property Static member DarkViolet Gets the solid fill color that has a hexadecimal value of #FF9400D3.
Public property Static member DeepPink Gets the solid fill color that has a hexadecimal value of #FFFF1493.
Public property Static member DeepSkyBlue Gets the solid fill color that has a hexadecimal value of #FF00BFFF.
Public property Static member DimGray Gets the solid fill color that has a hexadecimal value of #FF696969.
Public property Static member DodgerBlue Gets the solid fill color that has a hexadecimal value of #FF1E90FF.
Public property Static member Firebrick Gets the solid fill color that has a hexadecimal value of #FFB22222.
Public property Static member FloralWhite Gets the solid fill color that has a hexadecimal value of #FFFFFAF0.
Public property Static member ForestGreen Gets the solid fill color that has a hexadecimal value of #FF228B22.
Public property Static member Fuchsia Gets the solid fill color that has a hexadecimal value of #FFFF00FF.
Public property Static member Gainsboro Gets the solid fill color that has a hexadecimal value of #FFDCDCDC.
Public property Static member GhostWhite Gets the solid fill color that has a hexadecimal value of #FFF8F8FF.
Public property Static member Gold Gets the solid fill color that has a hexadecimal value of #FFFFD700.
Public property Static member Goldenrod Gets the solid fill color that has a hexadecimal value of #FFDAA520.
Public property Static member Gray Gets the solid fill color that has a hexadecimal value of #FF808080.
Public property Static member Green Gets the solid fill color that has a hexadecimal value of #FF008000.
Public property Static member GreenYellow Gets the solid fill color that has a hexadecimal value of #FFADFF2F.
Public property Static member Honeydew Gets the solid fill color that has a hexadecimal value of #FFF0FFF0.
Public property Static member HotPink Gets the solid fill color that has a hexadecimal value of #FFFF69B4.
Public property Static member IndianRed Gets the solid fill color that has a hexadecimal value of #FFCD5C5C.
Public property Static member Indigo Gets the solid fill color that has a hexadecimal value of #FF4B0082.
Public property Static member Ivory Gets the solid fill color that has a hexadecimal value of #FFFFFFF0.
Public property Static member Khaki Gets the solid fill color that has a hexadecimal value of #FFF0E68C.
Public property Static member Lavender Gets the solid fill color that has a hexadecimal value of #FFE6E6FA.
Public property Static member LavenderBlush Gets the solid fill color that has a hexadecimal value of #FFFFF0F5.
Public property Static member LawnGreen Gets the solid fill color that has a hexadecimal value of #FF7CFC00.
Public property Static member LemonChiffon Gets the solid fill color that has a hexadecimal value of #FFFFFACD.
Public property Static member LightBlue Gets the solid fill color that has a hexadecimal value of #FFADD8E6.
Public property Static member LightCoral Gets the solid fill color that has a hexadecimal value of #FFF08080.
Public property Static member LightCyan Gets the solid fill color that has a hexadecimal value of #FFE0FFFF.
Public property Static member LightGoldenrodYellow Gets the solid fill color that has a hexadecimal value of #FFFAFAD2.
Public property Static member LightGray Gets the solid fill color that has a hexadecimal value of #FFD3D3D3.
Public property Static member LightGreen Gets the solid fill color that has a hexadecimal value of #FF90EE90.
Public property Static member LightPink Gets the solid fill color that has a hexadecimal value of #FFFFB6C1.
Public property Static member LightSalmon Gets the solid fill color that has a hexadecimal value of #FFFFA07A.
Public property Static member LightSeaGreen Gets the solid fill color that has a hexadecimal value of #FF20B2AA.
Public property Static member LightSkyBlue Gets the solid fill color that has a hexadecimal value of #FF87CEFA.
Public property Static member LightSlateGray Gets the solid fill color that has a hexadecimal value of #FF778899.
Public property Static member LightSteelBlue Gets the solid fill color that has a hexadecimal value of #FFB0C4DE.
Public property Static member LightYellow Gets the solid fill color that has a hexadecimal value of #FFFFFFE0.
Public property Static member Lime Gets the solid fill color that has a hexadecimal value of #FF00FF00.
Public property Static member LimeGreen Gets the solid fill color that has a hexadecimal value of #FF32CD32.
Public property Static member Linen Gets the solid fill color that has a hexadecimal value of #FFFAF0E6.
Public property Static member Magenta Gets the solid fill color that has a hexadecimal value of #FFFF00FF.
Public property Static member Maroon Gets the solid fill color that has a hexadecimal value of #FF800000.
Public property Static member MediumAquamarine Gets the solid fill color that has a hexadecimal value of #FF66CDAA.
Public property Static member MediumBlue Gets the solid fill color that has a hexadecimal value of #FF0000CD.
Public property Static member MediumOrchid Gets the solid fill color that has a hexadecimal value of #FFBA55D3.
Public property Static member MediumPurple Gets the solid fill color that has a hexadecimal value of #FF9370DB.
Public property Static member MediumSeaGreen Gets the solid fill color that has a hexadecimal value of #FF3CB371.
Public property Static member MediumSlateBlue Gets the solid fill color that has a hexadecimal value of #FF7B68EE.
Public property Static member MediumSpringGreen Gets the solid fill color that has a hexadecimal value of #FF00FA9A.
Public property Static member MediumTurquoise Gets the solid fill color that has a hexadecimal value of #FF48D1CC.
Public property Static member MediumVioletRed Gets the solid fill color that has a hexadecimal value of #FFC71585.
Public property Static member MidnightBlue Gets the solid fill color that has a hexadecimal value of #FF191970.
Public property Static member MintCream Gets the solid fill color that has a hexadecimal value of #FFF5FFFA.
Public property Static member MistyRose Gets the solid fill color that has a hexadecimal value of #FFFFE4E1.
Public property Static member Moccasin Gets the solid fill color that has a hexadecimal value of #FFFFE4B5.
Public property Static member NavajoWhite Gets the solid fill color that has a hexadecimal value of #FFFFDEAD.
Public property Static member Navy Gets the solid fill color that has a hexadecimal value of #FF000080.
Public property Static member OldLace Gets the solid fill color that has a hexadecimal value of #FFFDF5E6.
Public property Static member Olive Gets the solid fill color that has a hexadecimal value of #FF808000.
Public property Static member OliveDrab Gets the solid fill color that has a hexadecimal value of #FF6B8E23.
Public property Static member Orange Gets the solid fill color that has a hexadecimal value of #FFFFA500.
Public property Static member OrangeRed Gets the solid fill color that has a hexadecimal value of #FFFF4500.
Public property Static member Orchid Gets the solid fill color that has a hexadecimal value of #FFDA70D6.
Public property Static member PaleGoldenrod Gets the solid fill color that has a hexadecimal value of #FFEEE8AA.
Public property Static member PaleGreen Gets the solid fill color that has a hexadecimal value of #FF98FB98.
Public property Static member PaleTurquoise Gets the solid fill color that has a hexadecimal value of #FFAFEEEE.
Public property Static member PaleVioletRed Gets the solid fill color that has a hexadecimal value of #FFDB7093.
Public property Static member PapayaWhip Gets the solid fill color that has a hexadecimal value of #FFFFEFD5.
Public property Static member PeachPuff Gets the solid fill color that has a hexadecimal value of #FFFFDAB9.
Public property Static member Peru Gets the solid fill color that has a hexadecimal value of #FFCD853F.
Public property Static member Pink Gets the solid fill color that has a hexadecimal value of #FFFFC0CB.
Public property Static member Plum Gets the solid fill color that has a hexadecimal value of #FFDDA0DD.
Public property Static member PowderBlue Gets the solid fill color that has a hexadecimal value of #FFB0E0E6.
Public property Static member Purple Gets the solid fill color that has a hexadecimal value of #FF800080.
Public property Static member Red Gets the solid fill color that has a hexadecimal value of #FFFF0000.
Public property Static member RosyBrown Gets the solid fill color that has a hexadecimal value of #FFBC8F8F.
Public property Static member RoyalBlue Gets the solid fill color that has a hexadecimal value of #FF4169E1.
Public property Static member SaddleBrown Gets the solid fill color that has a hexadecimal value of #FF8B4513.
Public property Static member Salmon Gets the solid fill color that has a hexadecimal value of #FFFA8072.
Public property Static member SandyBrown Gets the solid fill color that has a hexadecimal value of #FFF4A460.
Public property Static member SeaGreen Gets the solid fill color that has a hexadecimal value of #FF2E8B57.
Public property Static member SeaShell Gets the solid fill color that has a hexadecimal value of #FFFFF5EE.
Public property Static member Sienna Gets the solid fill color that has a hexadecimal value of #FFA0522D.
Public property Static member Silver Gets the solid fill color that has a hexadecimal value of #FFC0C0C0.
Public property Static member SkyBlue Gets the solid fill color that has a hexadecimal value of #FF87CEEB.
Public property Static member SlateBlue Gets the solid fill color that has a hexadecimal value of #FF6A5ACD.
Public property Static member SlateGray Gets the solid fill color that has a hexadecimal value of #FF708090.
Public property Static member Snow Gets the solid fill color that has a hexadecimal value of #FFFFFAFA.
Public property Static member SpringGreen Gets the solid fill color that has a hexadecimal value of #FF00FF7F.
Public property Static member SteelBlue Gets the solid fill color that has a hexadecimal value of #FF4682B4.
Public property Static member Tan Gets the solid fill color that has a hexadecimal value of #FFD2B48C.
Public property Static member Teal Gets the solid fill color that has a hexadecimal value of #FF008080.
Public property Static member Thistle Gets the solid fill color that has a hexadecimal value of #FFD8BFD8.
Public property Static member Tomato Gets the solid fill color that has a hexadecimal value of #FFFF6347.
Public property Static member Transparent Gets the solid fill color that has a hexadecimal value of #00FFFFFF.
Public property Static member Turquoise Gets the solid fill color that has a hexadecimal value of #FF40E0D0.
Public property Static member Violet Gets the solid fill color that has a hexadecimal value of #FFEE82EE.
Public property Static member Wheat Gets the solid fill color that has a hexadecimal value of #FFF5DEB3.
Public property Static member White Gets the solid fill color that has a hexadecimal value of #FFFFFFFF.
Public property Static member WhiteSmoke Gets the solid fill color that has a hexadecimal value of #FFF5F5F5.
Public property Static member Yellow Gets the solid fill color that has a hexadecimal value of #FFFFFF00.
Public property Static member YellowGreen Gets the solid fill color that has a hexadecimal value of #FF9ACD32.
Top
  Name Description
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Top

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).

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.
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>



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.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Add a column with the actual color
Please add a column with the actual color.
Brushes returned are already frozen.
Brushes returned are already frozen.