<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/tint(_:)-93mfq",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE4tintyQrqd__SgAA10ShapeStyleRd__lF"
  },
  "title" : "tint(_:)"
}
-->

# tint(_:)

Sets the tint within this view.

```
nonisolated func tint<S>(_ tint: S?) -> some View where S : ShapeStyle
```

## Parameters

`tint`

The tint to apply.

## Discussion

Use this method to override the default accent color for this view with
a given styling. Unlike an app’s accent color, which can be
overridden by user preference, tint is always respected and should
be used as a way to provide additional meaning to the control.

Controls which are unable to style themselves using the given type of
`ShapeStyle` will try to approximate the styling as best as they can
(i.e. controls which can not style themselves using a gradient will
attempt to use the color of the gradient’s first stop).

This example shows a linear gauge tinted with a
gradient from `ShapeStyle/blue` to `ShapeStyle/red`.

```
struct ControlTint: View {
    var body: some View {
        Gauge(value: 75, in: 0...100) {
            Text("Temperature")
        }
        .gaugeStyle(.linearCapacity)
        .tint(Gradient(colors: [.blue, .orange, .red]))
    }
}
```

Some controls adapt to the tint color differently based on their style,
the current platform, and the surrounding context. For example, in
macOS, a button with the `PrimitiveButtonStyle/bordered` style doesn’t
tint its background, but one with the
`PrimitiveButtonStyle/borderedProminent` style does. In macOS, neither
of these button styles tint their label, but they do in other platforms.

---

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)