Color

public extension Color
  • Extension to Color, to return colors from the latest version of preset color palette used by ThemeManager.

    Declaration

    Swift

    static func preferredColor(_ style: ColorStyle, background scheme: BackgroundColorScheme? = .device, interface level: InterfaceLevel? = .device, display mode: ColorDisplayMode? = .device) -> Color

    Parameters

    style

    ColorStyle enum from the color palette.

    scheme

    specifies whether the color should be used in front of a light background, or a dark background. E.g. a “white” background is a “light” background. A “dark blue” background is a “dark” background. Defaults to .device.

    level

    specifies whether the color should be used in the base or elevated level of the interface. E.g. alerts and popovers will be assigned with the elevated interface level. Defaults to .device.

    Return Value

    a dynamic color provider wrapped in Color

  • Extension to Color, to resolve a static form of Color from the wrapped dynamic color provider.

    Declaration

    Swift

    func resolvedColor(with scheme: ColorScheme? = .light, in level: UIUserInterfaceLevel? = .base) -> Color

    Parameters

    scheme

    specifies whether the color should be used in front of a light background, or a dark background. Defaults to .light.

    level

    specifies whether the color should be used in the base or elevated level of the interface. Defaults to .base.

    Return Value

    a static form of Colorresolved from the dynamic color provider.

  • Undocumented

    Declaration

    Swift

    func uiColor() -> UIColor