Class RecolorBrush
Provides an implementation of a brush that can recolor an image
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.Drawing.Processing
Assembly: SixLabors.ImageSharp.Drawing.dll
Syntax
public sealed class RecolorBrush : IBrush
Constructors
| Improve this Doc View SourceRecolorBrush(Color, Color, Single)
Initializes a new instance of the RecolorBrush class.
Declaration
public RecolorBrush(Color sourceColor, Color targetColor, float threshold)
Parameters
Type | Name | Description |
---|---|---|
Color | sourceColor | Color of the source. |
Color | targetColor | Color of the target. |
Single | threshold | The threshold as a value between 0 and 1. |
Properties
| Improve this Doc View SourceSourceColor
Gets the source color.
Declaration
public Color SourceColor { get; }
Property Value
Type | Description |
---|---|
Color |
TargetColor
Gets the target color.
Declaration
public Color TargetColor { get; }
Property Value
Type | Description |
---|---|
Color |
Threshold
Gets the threshold.
Declaration
public float Threshold { get; }
Property Value
Type | Description |
---|---|
Single |
Methods
| Improve this Doc View SourceCreateApplicator<TPixel>(Configuration, GraphicsOptions, ImageFrame<TPixel>, RectangleF)
Creates the applicator for this brush.
Declaration
public BrushApplicator<TPixel> CreateApplicator<TPixel>(Configuration configuration, GraphicsOptions options, ImageFrame<TPixel> source, RectangleF region)
where TPixel : struct, IPixel<TPixel>
Parameters
Type | Name | Description |
---|---|---|
Configuration | configuration | The configuration instance to use when performing operations. |
GraphicsOptions | options | The graphic options. |
ImageFrame<TPixel> | source | The source image. |
RectangleF | region | The region the brush will be applied to. |
Returns
Type | Description |
---|---|
BrushApplicator<TPixel> | The BrushApplicator<TPixel> for this brush. |
Type Parameters
Name | Description |
---|---|
TPixel | The pixel type. |
Remarks
The region
when being applied to things like shapes would usually be the
bounding box of the shape not necessarily the bounds of the whole image.