public static Brush CreateLinearGradient(
float angle,
ColorF startColor,
ColorF endColor,
WorkingColorSpace workingColorSpace = WorkingColorSpace.Default
)Public Shared Function CreateLinearGradient (
angle As Single,
startColor As ColorF,
endColor As ColorF,
Optional workingColorSpace As WorkingColorSpace = WorkingColorSpace.Default
) As Brushpublic:
static Brush^ CreateLinearGradient(
float angle,
ColorF startColor,
ColorF endColor,
WorkingColorSpace workingColorSpace = WorkingColorSpace::Default
)static member CreateLinearGradient :
angle : float32 *
startColor : ColorF *
endColor : ColorF *
?workingColorSpace : WorkingColorSpace
(* Defaults:
let _workingColorSpace = defaultArg workingColorSpace WorkingColorSpace.Default
*)
-> Brush This overload creates a gradient with dynamic coordinates, applying the gradient automatically to the bounds of each Path. To use fix coordinates instead, use the overloads with a startPoint and endPoint parameters, such as the CreateLinearGradient(PointF, PointF, Color32, Color32, GradientWrapMode, WorkingColorSpace) overload.
The workingColorSpace parameter affects only the color interpolation, not the blending with the background, which is determined by the color space of the target bitmap data (or by DrawingOptions.Quantizer, if specified).
In this overload the default value of workingColorSpace maps to WorkingColorSpace.Linear, because the ColorF type represents a color in the linear color space. When creating a monochromatic gradient, specifying Srgb can be better, because then the perceived mid-tone brightness will be at the middle of the gradient. Otherwise, using Linear may be more appropriate, so the transition between the colors will seem more "natural".