https://github.com/devxoul/swiftycolor
🎨 The most sexy way to use colors in Swift.
https://github.com/devxoul/swiftycolor
color swift
Last synced: 3 months ago
JSON representation
🎨 The most sexy way to use colors in Swift.
- Host: GitHub
- URL: https://github.com/devxoul/swiftycolor
- Owner: devxoul
- License: mit
- Created: 2015-01-13T18:04:44.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-03-21T23:27:11.000Z (over 5 years ago)
- Last Synced: 2025-03-12T19:47:19.467Z (4 months ago)
- Topics: color, swift
- Language: Swift
- Homepage:
- Size: 34.2 KB
- Stars: 121
- Watchers: 7
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
SwiftyColor
===========
[](http://cocoapods.org/?q=name%3ASwiftyColor%20author%3Adevxoul)
[](http://github.com/devxoul/SwiftyColor/actions)The most sexy way to use colors in Swift. Both compatible with iOS and macOS.
Color from Hex
--------------```swift
let color = 0x123456.color
```Alpha Operator
--------------Use infix operator `~`.
```swift
let transparent = 0x123456.color ~ 50%
let red = UIColor.red ~ 10%
let float = UIColor.blue ~ 0.5 // == 50%
```Percent Operator
----------------```swift
let view = UIView()
view.alpha = 30% // == 0.3
```License
-------SwiftyColor is under MIT license. See LICENSE file for more information.