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

# style(_:)

Returns a shading instance that fills with the given shape style.

## Declaration

```swift
static func style<S>(_ style: S) -> GraphicsContext.Shading where S : ShapeStyle
```

## Parameters

- `style`: A doc://com.apple.SwiftUI/documentation/SwiftUI/ShapeStyle instance to draw with.

## Return Value

Return Value A shading instance filled with a shape style.

## Discussion

Discussion Styles with geometry defined in a unit coordinate space map that space to the rectangle associated with the drawn object. You can adjust that using the in(_:) method. The shape style might affect the blend mode and opacity of the drawn object.

## See Also

### Other shape styles

- [foreground](swiftui/graphicscontext/shading/foreground.md)
