Click or drag to resize

ExtensionsClassCalculateGradient Method

LightningChart .NET Help
Calculate gradient from color to the other with amount given as pecents. Each channel is calculated separately and changed with channgel difference multiplied by the defined factor.

Namespace:  Arction.WinForms.Charting
Assembly:  Arction.WinForms.Charting.LightningChart (in Arction.WinForms.Charting.LightningChart.dll) Version: 10.3.1
Syntax
public static Color CalculateGradient(
	this Color colorFrom,
	Color colorTo,
	double positionPercents
)

Parameters

colorFrom
Type: System.DrawingColor
Source color to start from.
colorTo
Type: System.DrawingColor
Destination color to move towards.
positionPercents
Type: SystemDouble
Factor to move by, as percents. Negative and values over 100 are valid, though channel values are capped to between [0, 255].

Return Value

Type: Color
Resulting color

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Color. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also