wxxsw / SwiftTheme

🎨 Powerful theme/skin manager for iOS 9+ 主题/换肤, 暗色模式
MIT License
2.52k stars 305 forks source link

How to use theme_colors in plistdome to create a gradient background color for the background #135

Closed CongHaipeng closed 4 years ago

wxxsw commented 4 years ago

Demo:

glayer.theme_colors = [
    [UIColor.red.cgColor, UIColor.blue.cgColor],
    [UIColor.green.cgColor, UIColor.yellow.cgColor],
]

Plist Demo:

gLayer.theme_colors = ThemeAnyPicker(keyPath: "someKey") { value in
    if let hexArray = value as? [String] {
        return hexArray.map { UIColor(hex: $0).cgColor }
    }
    return nil
}