---
title: gradient
framework: swiftui
role: symbol
role_heading: Instance Property
path: swiftui/color/gradient
---

# gradient

Returns the standard gradient for the color self.

## Declaration

```swift
var gradient: AnyGradient { get }
```

## Discussion

Discussion For example, filling a rectangle with a gradient derived from the standard blue color: Rectangle().fill(.blue.gradient)

## See Also

### Modifying a color

- [opacity(_:)](swiftui/color/opacity(_:).md)
- [mix(with:by:in:)](swiftui/color/mix(with:by:in:).md)
- [exposureAdjust(_:)](swiftui/color/exposureadjust(_:).md)
- [headroom(_:)](swiftui/color/headroom(_:).md)
