Class GradientStop
Defines the different colors and the regions of color transitions.
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class GradientStop : DiagramObject, IDiagramObject, ICloneable
Constructors
GradientStop()
Initializes a new instance of the GradientStop.
Declaration
public GradientStop()
GradientStop(GradientStop)
Creates a new instance of the GradientStop from the given GradientStop.
Declaration
public GradientStop(GradientStop src)
Parameters
Type | Name | Description |
---|---|---|
GradientStop | src | GradientStop. |
Properties
Color
Gets or sets the color to be filled over the specified region.
Declaration
public string Color { get; set; }
Property Value
Type |
---|
System.String |
Examples
Node Node = new Node()
{
Style = new ShapeStyle()
{
Gradient = new RadialGradientBrush()
{
//Center point of the inner circle
FX = 20,
FY = 20,
//Center point of the outer circle
CX = 50,
CY = 50,
//Radius of a radial gradient
R = 50,
//Set an array of stop objects
GradientStops = new DiagramObjectCollection<GradientStop>()
{
new GradientStop(){ Color = "white", Offset = 0},
new GradientStop(){ Color = "#6BA5D7", Offset = 100}
},
}
},
};
Offset
Gets or sets the position at which the previous color transition ends, and a new color transition starts.
Declaration
public Nullable<double> Offset { get; set; }
Property Value
Type |
---|
System.Nullable<System.Double> |
Examples
Node Node = new Node()
{
Style = new ShapeStyle()
{
Gradient = new RadialGradientBrush()
{
//Center point of the inner circle
FX = 20,
FY = 20,
//Center point of the outer circle
CX = 50,
CY = 50,
//Radius of a radial gradient
R = 50,
//Set an array of stop objects
GradientStops = new DiagramObjectCollection<GradientStop>()
{
new GradientStop(){ Color = "white", Offset = 0},
new GradientStop(){ Color = "#6BA5D7", Offset = 100}
},
}
},
};
Opacity
Gets or sets the transparency level of the region.
Declaration
public double Opacity { get; set; }
Property Value
Type |
---|
System.Double |
Examples
Node Node = new Node()
{
Style = new ShapeStyle()
{
Gradient = new RadialGradientBrush()
{
//Center point of the inner circle
FX = 20,
FY = 20,
//Center point of the outer circle
CX = 50,
CY = 50,
//Radius of a radial gradient
R = 50,
//Set an array of stop objects
GradientStops = new DiagramObjectCollection<GradientStop>()
{
new GradientStop(){ Color = "#6BA5D7", Offset = 100,Opacity=0.5}
},
}
},
};
Methods
Clone()
Creates a new object that is a copy of the current gradient stop.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object | GradientStop |
Overrides
Implements
System.ICloneable