Classes

The following classes are available globally.

  • Manager class which supplies color palette values to Fiori components, and the Color.preferredColor(_:background:interface:display:) API.

    Changes made to the manager affect all future calls to Color.preferredColor(_:background:interface:display:). Most components do not reload dynamically, so calls to the ThemeManager should happen at the beginning of the application lifecycle.

    Note

    AppDelegate.didFinishLaunching(withOptions...) is the recommended location.

    Example Usage

    // Pin palette version used by application to a specific version (defaults to `.latest`)
    ThemeManager.shared.setPaletteVersion(.v7)
    
    // Override some color definitions to match your application palette
    ThemeManager.shared.setColor(.darkGray, for: .primary2, background: .light)
    ThemeManager.shared.setHexColor("1b931d", for: .positive, background: .light)
    
    See more

    Declaration

    Swift

    public class ThemeManager