UIColor-Hex-Swift alternatives and similar libraries
Based on the "Colors" category.
Alternatively, view UIColor-Hex-Swift alternatives based on common mentions on social networks and blogs.
-
Chameleon
Chameleon is a lightweight, yet powerful, color framework for iOS (Objective-C & Swift). -
SwiftGen-Colors
A tool to auto-generate Swift enums for your UIColor constants. -
Hue
Hue is the all-in-one coloring utility that you'll ever need. -
DynamicColor
An extension to manipulate colors in Swift easily. -
SwiftHEXColors
HEX color handling as an extension for UIColor. -
ChromaColorPicker
An intuitive and fun iOS color picker. -
RandomColorSwift
An attractive color generator for Swift (ported from randomColor.js). -
UIGradient
A simple and powerful library for using gradient layer, image, color -
PrettyColors
Styles and colors text in the Terminal with ANSI escape codes. Conforms to ECMA Standard 48. -
AEConicalGradient
Conical (angular) gradient in Swift. -
UIColor-WikiColors
All wikipedia colors implemented as easy to use UIColor extension. -
CSS3ColorsSwift
A UIColor extension with CSS3 Colors name. -
Google Material Color
Google Material Color Palette in Swift.
Scout APM - Leading-edge performance monitoring starting at $39/month
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of UIColor-Hex-Swift or a related project?
README
UIColor+Hex, now Swift.
Convenience method for creating autoreleased color using RGBA hex string.
// Solid color
let strokeColor = UIColor("#FFCC00").cgColor
// Color with alpha
let fillColor = UIColor("#FFCC00DD").cgColor
// Supports shorthand 3 character representation
let backgroundColor = UIColor("#FFF")
// Supports shorthand 4 character representation (with alpha)
let menuTextColor = UIColor("#013E")
// "#FF0000FF"
let hexString = UIColor.red.hexString()
// Convert shorthand 4 character representation (with alpha) from argb to rgba
if let rgba = "#AFFF".argb2rgba {
let androidBackgroundColor = UIColor(rgba)
}
// Convert 8 character representation (with alpha) from argb to rgba
if let rgba = "#AAFFFFFF".argb2rgba {
let androidFrontColor = UIColor(rgba)
}
Release Notes
- Upgrade to Swift 5.
- macOS gets supported.
Installation
Swift Package Manager
To add a package dependency to your Xcode project, select File > Swift Packages > Add Package Dependency and enter https://github.com/yeahdongcn/UIColor-Hex-Swift to the text field.
CocoaPods
Simply add the following lines to your Podfile
:
# required by CocoaPods 0.36.0.rc.1 for Swift Pods
use_frameworks!
pod 'UIColor_Hex_Swift', '~> 5.1.1'
Then import it where you use it:
import UIColor_Hex_Swift
(CocoaPods v0.36 or later required. See this blog post for details.)
Carthage
Simply add the following line to your Cartfile
:
github "yeahdongcn/UIColor-Hex-Swift" >= 5.1.1
Then add the HexColor.framework to your frameworks list in the Xcode project.
Then import it where you use it:
import HEXColor
See more in RSBarcodes_Swift and objc version
*Note that all licence references and agreements mentioned in the UIColor-Hex-Swift README section above
are relevant to that project's source code only.