Class DrawConfig
Record used to configure drawing parameters for an SVG shape.
Implements
Inherited Members
Namespace: OpenSvg.Config
Assembly: OpenSvg.dll
Syntax
public record DrawConfig : IEquatable<DrawConfig>
Remarks
Provides properties to set the fill color, stroke color, and stroke width for SVG shapes.
Constructors
| Edit this page View SourceDrawConfig()
Declaration
public DrawConfig()
DrawConfig(SKColor, SKColor, float)
Record used to configure drawing parameters for an SVG shape.
Declaration
public DrawConfig(SKColor FillColor, SKColor StrokeColor, float StrokeWidth)
Parameters
Type | Name | Description |
---|---|---|
SKColor | FillColor | |
SKColor | StrokeColor | |
float | StrokeWidth |
Remarks
Provides properties to set the fill color, stroke color, and stroke width for SVG shapes.
Properties
| Edit this page View SourceDefaultFillColor
Declaration
public static SKColor DefaultFillColor { get; }
Property Value
Type | Description |
---|---|
SKColor |
DefaultStrokeColor
Declaration
public static SKColor DefaultStrokeColor { get; }
Property Value
Type | Description |
---|---|
SKColor |
DefaultStrokeWidth
Declaration
public static float DefaultStrokeWidth { get; }
Property Value
Type | Description |
---|---|
float |
FillColor
Declaration
public SKColor FillColor { get; init; }
Property Value
Type | Description |
---|---|
SKColor |
StrokeColor
Declaration
public SKColor StrokeColor { get; init; }
Property Value
Type | Description |
---|---|
SKColor |
StrokeWidth
Declaration
public float StrokeWidth { get; init; }
Property Value
Type | Description |
---|---|
float |
Transparent
Gets a transparent DrawConfig instance. One use-case is for creating invisible spaces between shapes.
Declaration
public static DrawConfig Transparent { get; }
Property Value
Type | Description |
---|---|
DrawConfig |
Methods
| Edit this page View SourceWithFillColor(SKColor)
Returns a new copy of the DrawConfig record with the specified fill color.
Declaration
public DrawConfig WithFillColor(SKColor fillColor)
Parameters
Type | Name | Description |
---|---|---|
SKColor | fillColor | The new fill color to set. |
Returns
Type | Description |
---|---|
DrawConfig | A new DrawConfig with the specified fill color. |
WithStrokeColor(SKColor)
Returns a new copy of the DrawConfig record with the specified stroke color.
Declaration
public DrawConfig WithStrokeColor(SKColor strokeColor)
Parameters
Type | Name | Description |
---|---|---|
SKColor | strokeColor | The new stroke color to set. |
Returns
Type | Description |
---|---|
DrawConfig | A new DrawConfig with the specified stroke color. |
WithStrokeWidth(float)
Returns a new copy of the DrawConfig record with the specified stroke width.
Declaration
public DrawConfig WithStrokeWidth(float strokeWidth)
Parameters
Type | Name | Description |
---|---|---|
float | strokeWidth | The new stroke width to set. |
Returns
Type | Description |
---|---|
DrawConfig | A new DrawConfig with the specified stroke width. |