Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kofktu/uiapplecolor
Apple System Colors
https://github.com/kofktu/uiapplecolor
Last synced: about 2 months ago
JSON representation
Apple System Colors
- Host: GitHub
- URL: https://github.com/kofktu/uiapplecolor
- Owner: Kofktu
- License: mit
- Created: 2019-10-13T01:56:13.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-05T06:52:13.000Z (over 4 years ago)
- Last Synced: 2024-10-13T14:45:25.885Z (2 months ago)
- Language: Swift
- Size: 46.9 KB
- Stars: 37
- Watchers: 5
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UIAppleColor
[![Build Status](https://travis-ci.org/Kofktu/Sniffer.svg?branch=master)](https://travis-ci.org/Kofktu/UIAppleColor)
![Swift](https://img.shields.io/badge/Swift-5.0-orange.svg)
[![CocoaPods](http://img.shields.io/cocoapods/v/UIAppleColor.svg?style=flat)](http://cocoapods.org/?q=name%3ASniffer%20author%3AKofktu)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)- Apple System Color
- Versions below iOS 13 use the Light/Dark Mode Color## Example
```swift
let label = UILabel()if #available(iOS 13.0, *) {
label.textColor = .label
} else {
label.textColor = .black
}// Use UIAppleColor
label.textColor = UIColor.apple.label
``````swift
public extension UIColor {
static let apple: UIAppleColor
}public struct UIAppleColor {
var systemBackground: UIColor
var secondarySystemBackground: UIColor
var tertiarySystemBackground: UIColorvar systemGroupedBackground: UIColor
var secondarySystemGroupedBackground: UIColor
var tertiarySystemGroupedBackground: UIColorvar systemFill: UIColor
var secondarySystemFill: UIColor
var tertiarySystemFill: UIColor
var quaternarySystemFill: UIColorvar lightText: UIColor
var darkText: UIColor
var label: UIColor
var secondaryLabel: UIColor
var tertiaryLabel: UIColor
var quaternaryLabel: UIColorvar link: UIColor
var placeholderText: UIColor
var separator: UIColor
var opaqueSeparator: UIColorvar 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
```swift
// once in the first time
UIAppleColor.setup(mode: .dark)let label = UILabel()
label.textColor = UIColor.apple.label
``````swift
let label = UILabel()
label.textColor = UIColor.apple.mode(.dark).label
```## Installation
#### CocoaPods
UIAppleColor is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod "UIAppleColor"
```#### Carthage
For iOS 8+ projects with [Carthage](https://github.com/Carthage/Carthage)```
github "Kofktu/UIAppleColor"
```## References
- Apple HIG Color (https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/color/)## Authors
Taeun Kim (kofktu),
## License
Sniffer is available under the ```MIT``` license. See the ```LICENSE``` file for more info.