uia

UIAppleColor

Apple System Colors

Showing:

Popularity

Downloads/wk

0

GitHub Stars

39

Maintenance

Last Commit

1yr ago

Contributors

1

Package

Dependencies

0

License

MIT

Categories

Readme

UIAppleColor

Build Status Swift CocoaPods Carthage compatible

  • Apple System Color
  • Versions below iOS 13 use the Light/Dark Mode Color

Example

let label = UILabel()

if #available(iOS 13.0, *) {
    label.textColor = .label
} else {
    label.textColor = .black
}

// Use UIAppleColor
label.textColor = UIColor.apple.label
public extension UIColor {
    static let apple: UIAppleColor
}

public struct UIAppleColor {
    var systemBackground: UIColor
    var secondarySystemBackground: UIColor
    var tertiarySystemBackground: UIColor

    var systemGroupedBackground: UIColor
    var secondarySystemGroupedBackground: UIColor
    var tertiarySystemGroupedBackground: UIColor

    var systemFill: UIColor
    var secondarySystemFill: UIColor
    var tertiarySystemFill: UIColor
    var quaternarySystemFill: UIColor

    var lightText: UIColor
    var darkText: UIColor
    var label: UIColor
    var secondaryLabel: UIColor
    var tertiaryLabel: UIColor
    var quaternaryLabel: UIColor

    var link: UIColor
    var placeholderText: UIColor
    var separator: UIColor
    var opaqueSeparator: UIColor

    var systemRed: UIColor
    var systemGreen: UIColor
    var systemBlue: UIColor
    var systemOrange: UIColor
    var systemYellow: UIColor
    var systemPink: UIColor
    var systemPurple: UIColor
    var systemTeal: UIColor
    var systemIndigo: UIColor
    var systemGray: UIColor
    var systemGray2: UIColor
    var systemGray3: UIColor
    var systemGray4: UIColor
    var systemGray5: UIColor
    var systemGray6: UIColor
}

When using dark mode below iOS 13

// once in the first time
UIAppleColor.setup(mode: .dark)

let label = UILabel()
label.textColor = UIColor.apple.label
let label = UILabel()
label.textColor = UIColor.apple.mode(.dark).label

Installation

CocoaPods

UIAppleColor is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "UIAppleColor"

Carthage

For iOS 8+ projects with Carthage

github "Kofktu/UIAppleColor"

References

Authors

Taeun Kim (kofktu), kofktu@gmail.com

License

Sniffer is available under the MIT license. See the LICENSE file for more info.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100