Instance Property


The color scheme of this environment.


var colorScheme: ColorScheme { get set }


When writing custom drawing code that depends on the current color scheme, you should also consider the colorSchemeContrast property. You can specify images and colors in asset catalogs according to either the ColorScheme.light or ColorScheme.dark color scheme, as well as standard or increased contrast. The correct image or color displays automatically for the current environment.

You only need to check colorScheme and colorSchemeContrast for custom drawing if the differences go beyond images and colors.