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
Syntaxpublic static Color CalculateGradient(
this Color colorFrom,
Color colorTo,
double positionPercents
)
<ExtensionAttribute>
Public Shared Function CalculateGradient (
colorFrom As Color,
colorTo As Color,
positionPercents As Double
) As Color
public:
[ExtensionAttribute]
static Color CalculateGradient(
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:
ColorResulting 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