Saturation controls the intensity of the colors. The default value is always 1. As you increase the saturation value, the color become more intense. But when you decrease the number, the color become less intense and move toward the shades of gray.
Adjusts the color saturation of the view.Apple Documentation
In this tutorial, you’ll learn what is Saturation in SwiftUI. You’ll learn:
- How to use Saturation.
To follow along this tutorial, you’ll need some basic knowledge in:
- A basic familiarity with Swift.
- At least Xcode 11
Here you will see the intensity differences based on the saturation from 0 to 5. You may choose to adjust the saturation from time to time.
.frame(width: 50, height: 50)
This effect can be applied to images as well.
.frame(width: 120, height: 120)
.overlay(Text("1"), alignment: .bottom)
Where to go From Here
If you feel like you are ready to take on more challenges, feel free to check out some other tutorials that we have created: