<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Gradient",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI8GradientV"
  },
  "title" : "Gradient"
}
-->

# Gradient

A color gradient represented as an array of color stops, each having a
parametric location value.

```
@frozen struct Gradient
```

## Topics

### Creating a gradient from colors

[`init(colors:)`](/documentation/SwiftUI/Gradient/init(colors:))

Creates a gradient from an array of colors.

### Creating a gradient from stops

[`init(stops:)`](/documentation/SwiftUI/Gradient/init(stops:))

Creates a gradient from an array of color stops.

[`stops`](/documentation/SwiftUI/Gradient/stops)

The array of color stops.

[`Gradient.Stop`](/documentation/SwiftUI/Gradient/Stop)

One color stop in the gradient.

### Working with color spaces

[`colorSpace(_:)`](/documentation/SwiftUI/Gradient/colorSpace(_:))

Returns a version of the gradient that will use a specified
color space for interpolating between its colors.

[`Gradient.ColorSpace`](/documentation/SwiftUI/Gradient/ColorSpace)

A method of interpolating between the colors in a gradient.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)