Contents

EllipticalGradient

A radial gradient that draws an ellipse.

Declaration

@frozen struct EllipticalGradient

Overview

The gradient maps its coordinate space to the unit space square in which its center and radii are defined, then stretches that square to fill its bounding rect, possibly also stretching the circular gradient to have elliptical contours.

For example, an elliptical gradient centered on the view, filling its bounds:

EllipticalGradient(gradient: .init(colors: [.red, .yellow]))

When using an elliptical gradient as a shape style, you can also use ellipticalGradient(_:center:startRadiusFraction:endRadiusFraction:).

Topics

Creating an elliptical gradient

See Also

Supporting types