One Logo Pool Ball
SwiftUICore · IOS API REFERENCE

LinearGradient

struct · iOS 13.0+ · SDK 27.1

@frozen nonisolated struct LinearGradient

A linear gradient. The gradient applies the color function along an axis, as defined by its start and end points. The gradient maps the unit space points into the bounding rectangle of each shape filled with the gradient. When using a linear gradient as a shape style, you can also use ``ShapeStyle/linearGradient(_:startPoint:endPoint:)``.

Members (3)

init · iOS 13.0+

init

TypeScript
static initStopsStartPointEndPoint(stops: Array<Gradient_Stop>, startPoint: UnitPoint, endPoint: UnitPoint): LinearGradient
Swift declaration
@export(implementation) nonisolated init(stops: [Gradient.Stop], startPoint: UnitPoint, endPoint: UnitPoint)

Creates a linear gradient from a collection of color stops.

init · iOS 13.0+

init

TypeScript
static initColorsStartPointEndPoint(colors: Array<Color>, startPoint: UnitPoint, endPoint: UnitPoint): LinearGradient
Swift declaration
@export(implementation) nonisolated init(colors: [Color], startPoint: UnitPoint, endPoint: UnitPoint)

Creates a linear gradient from a collection of colors.

init · iOS 13.0+

init

TypeScript
static initGradientStartPointEndPoint(gradient: Gradient, startPoint: UnitPoint, endPoint: UnitPoint): LinearGradient
Swift declaration
nonisolated init(gradient: Gradient, startPoint: UnitPoint, endPoint: UnitPoint)

Creates a linear gradient from a base gradient.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUICore types →