---
title: "color(_:)"
framework: swiftui
role: symbol
role_heading: Type Method
path: "swiftui/graphicscontext/shading/color(_:)"
---

# color(_:)

Returns a shading instance that fills with a color.

## Declaration

```swift
static func color(_ color: Color) -> GraphicsContext.Shading
```

## Parameters

- `color`: A doc://com.apple.SwiftUI/documentation/SwiftUI/Color instance that defines the color of the shading.

## Return Value

Return Value A shading instance filled with a color.

## See Also

### Colors

- [color(_:red:green:blue:opacity:)](swiftui/graphicscontext/shading/color(_:red:green:blue:opacity:).md)
- [color(_:white:opacity:)](swiftui/graphicscontext/shading/color(_:white:opacity:).md)
