Type Safely

Type Safely

Using a Gradient or Material As a Tint

Daily Coding Tip 157

Millie Sturgeon's avatar
Millie Sturgeon
Aug 16, 2022
∙ Paid
blue and pink light illustration
Photo by Gradienta on Unsplash

The .accentColor modifier has been deprecated, and in its place is a far more capable modifier called .tint. One version of it takes a Color, which is identical to .accentColor. The other one is generic, which makes it much more interesting:

@inlinable public func tint<S>(_ tint: S?) -> some View where S : ShapeStyle

Any type…

User's avatar

Continue reading this post for free, courtesy of Type Safely.

Or purchase a paid subscription.
© 2026 Type Safely · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture