Skip to content

Examples and Use Cases

Valeriy Malishevskyi edited this page May 6, 2023 · 1 revision

Working with Colors

The Swift Extensions library provides several extensions for working with colors, such as creating colors from RGB or hexadecimal values, or setting colors based on the current user interface style. For example, you can use the UIColor(light:dark:) initializer to create a color that automatically switches between a light and dark mode, like so:

let myColor = UIColor(light: .white, dark: .black)

Work in progress. More examples coming soon

Clone this wiki locally