Creates WPF Brush patterns including SolidColorBrush, LinearGradientBrush, RadialGradientBrush, ImageBrush, and VisualBrush. Use when filling shapes with colors, gradients, images, or tile patterns.
View on GitHubchristian289/dotnet-with-claudecode
wpf-dev-pack
February 1, 2026
Select agents to install to:
npx add-skill https://github.com/christian289/dotnet-with-claudecode/blob/main/wpf-dev-pack/skills/creating-wpf-brushes/SKILL.md -a claude-code --skill creating-wpf-brushesInstallation paths:
.claude/skills/creating-wpf-brushes/# WPF Brush Patterns
Brush types for filling shapes and backgrounds in WPF.
## 1. Brush Hierarchy
```
Brush (abstract)
├── SolidColorBrush ← Single color
├── GradientBrush
│ ├── LinearGradientBrush ← Linear gradient
│ └── RadialGradientBrush ← Radial gradient
├── TileBrush
│ ├── ImageBrush ← Image fill
│ ├── DrawingBrush ← Drawing fill
│ └── VisualBrush ← Visual element fill
└── BitmapCacheBrush ← Cached visual
```
---
## 2. SolidColorBrush
```xml
<!-- Inline color name -->
<Rectangle Fill="Blue"/>
<!-- Hex color -->
<Rectangle Fill="#FF2196F3"/>
<!-- With opacity -->
<Rectangle>
<Rectangle.Fill>
<SolidColorBrush Color="Blue" Opacity="0.5"/>
</Rectangle.Fill>
</Rectangle>
```
```csharp
// Code creation
var brush = new SolidColorBrush(Colors.Blue);
brush.Opacity = 0.5;
brush.Freeze(); // Performance optimization
```
---
## 3. LinearGradientBrush
```xml
<!-- Horizontal gradient (default) -->
<Rectangle Width="200" Height="100">
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
<GradientStop Color="#2196F3" Offset="0"/>
<GradientStop Color="#FF9800" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<!-- Diagonal gradient -->
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="#2196F3" Offset="0"/>
<GradientStop Color="#4CAF50" Offset="0.5"/>
<GradientStop Color="#FF9800" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
<!-- Vertical gradient -->
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="White" Offset="0"/>
<GradientStop Color="Black" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
```
**StartPoint/EndPoint**: Relative coordinates (0-1)
---
## 4. RadialGradientBrush
```xml
<!-- Basic radial -->
<Ellipse Width="200" Height="200">
<Ellipse.Fill>
<Radial