Method FillGradient
FillGradient(SKCanvas, SKRect, SKColor, SKColor, SKPoint, SKPoint)
Fills the specified rectangular area on the canvas with a linear gradient.
public static void FillGradient(SKCanvas canvas, SKRect rect, SKColor beginColor, SKColor endColor, SKPoint point1, SKPoint point2)
Parameters
canvasSKCanvasThe SKCanvas on which the gradient will be drawn. Cannot be
null.rectSKRectThe rectangular area to fill, specified as a SKRect. If the width or height is less than or equal to zero, the method does nothing.
beginColorSKColorThe starting color of the gradient.
endColorSKColorThe ending color of the gradient.
point1SKPointThe starting point of the gradient, specified as a SKPoint.
point2SKPointThe ending point of the gradient, specified as a SKPoint. If this point coincides with
point1, the method falls back to a solid fill usingbeginColor.
Remarks
This method creates a linear gradient between point1 and
point2 and fills the specified rectangle with it.
If the gradient points are identical, the
rectangle is filled with a solid color instead.