Color creation
Load colors from asset catalogs and create colors from raw component values.
Overview
Create color objects when you want to use specific colors in your UI, altering the raw component values used by grayscale, RGB, HSB, and CMYK. You can set the specified opacity and RGB component values to create personalized colors that fit your needs. Create colors dynamically by component values changing based on the currently active traits. You can use pattern colors to set the fill or stroke color.
Topics
Creating a color from component values
init(white:alpha:)init(hue:saturation:brightness:alpha:)init(red:green:blue:alpha:)init(red:green:blue:alpha:exposure:)init(red:green:blue:alpha:linearExposure:)init(displayP3Red:green:blue:alpha:)init(named:)init(named:inBundle:compatibleWithTraitCollection:)