Type Method 型メソッド

linearGradient(_:startPoint:endPoint:options:)

Returns a shading instance that fills a linear (axial) gradient.

Declaration 宣言

static func linearGradient(_ gradient: Gradient, startPoint: CGPoint, endPoint: CGPoint, options: GraphicsContext.GradientOptions = GradientOptions()) -> GraphicsContext.Shading

Return Value 戻り値

A shading instance filled with a linear gradient.

Parameters パラメータ

gradient

A Gradient instance that defines the colors of the gradient.

startPoint

The start point of the gradient axis.

endPoint

The end point of the gradient axis.

options

Options that you use to configure the gradient.

Discussion 議論

The shading instance defines an axis from startPoint to endPoint in the current user space and maps colors from gradient to lines perpendicular to the axis.