SwiftHEXColors alternatives and similar libraries
Based on the "Colors" category.
Alternatively, view SwiftHEXColors alternatives based on common mentions on social networks and blogs.
-
Chameleon
Color framework for Swift & Objective-C (Gradient colors, hexcode support, colors from images & more). -
SwiftGen-Colors
The Swift code generator for your assets, storyboards, Localizable.strings, โฆ โ Get rid of all String-based APIs! -
Hue
:art: Hue is the all-in-one coloring utility that you'll ever need. -
DynamicColor
Yet another extension to manipulate colors easily in Swift and SwiftUI -
UIColor-Hex-Swift
Convenience methods for creating color using RGBA hex string. -
Gradients
๐ A curated collection of splendid 180+ gradients made in swift -
ChromaColorPicker
:art: An intuitive iOS color picker built in Swift. -
RandomColorSwift
An attractive color generator for Swift. Ported from randomColor.js. -
UIGradient
A simple and powerful library for using gradient layer, image, color -
FlatUIColors
Flat UI color palette helpers written in Swift. -
PrettyColors
Styles and colors text in the Terminal with ANSI escape codes. Conforms to ECMA Standard 48. -
HexColor
Utility that lets you define UIColors in Swift as they've meant to be defined: as HEX values -
AEConicalGradient
Conical (angular) gradient for iOS written in Swift -
ImagePalette
Swift/iOS port of Android's Palette https://developer.android.com/reference/android/support/v7/graphics/Palette.html -
CSS3ColorsSwift
A UIColor extension with CSS3 Color names. -
Google Material Color
Google Material Color Palette in Swift -
UIColor-WikiColors
All wikipedia colors implemented as easy to use UIColor extension ๐ -
Colors
A pure Swift library for using ANSI codes. Basically makes command-line coloring and styling very easy!
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of SwiftHEXColors or a related project?
README
SwiftHEXColors
HEX color handling as an extension for UIColor. Written in Swift.
Examples
iOS
// With hash
let color: UIColor = UIColor(hexString: "#ff8942")
// Without hash, with alpha
let secondColor: UIColor = UIColor(hexString: "ff8942", alpha: 0.5)
// Short handling
let shortColorWithHex: UIColor = UIColor(hexString: "fff")
For those who don't want to type the double quotation, you can init a color from a real hex value (an Int
)
// With hash
let color: UIColor = UIColor(hex: 0xff8942)
// Without hash, with alpha
let secondColor: UIColor = UIColor(hex: 0xff8942, alpha: 0.5)
OSX
// With hash
let color: NSColor = NSColor(hexString: "#ff8942")
// Without hash, with alpha
let secondColor: NSColor = NSColor(hexString: "ff8942", alpha: 0.5)
// Short handling
let shortColorWithHex: NSColor = NSColor(hexString: "fff")
// From a real hex value (an `Int`)
// With hash
let color: NSColor = NSColor(hex: 0xff8942)
// Without hash, with alpha
let secondColor: NSColor = NSColor(hex: 0xff8942, alpha: 0.5)
Installation
Swift Package Manager
Add this as a dependency in your Package.swift
:
import PackageDescription
let package = Package(
name: "MyPackage",
dependencies: [
// Other dependencies
.package(url: "https://github.com/thii/SwiftHEXColors.git", from: "1.3.1")
]
)
CocoaPods
To integrate SwiftHEXColors into your Xcode project using CocoaPods, specify it in your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'SwiftHEXColors'
Then, run the following command:
$ pod install
And add import SwiftHEXColors
to the top of the files using SwiftHEXColors.
Carthage
Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with Homebrew using the following command:
$ brew update
$ brew install carthage
To integrate SwiftHEXColors into your Xcode project using Carthage, specify it in your Cartfile
:
github "thii/SwiftHEXColors"
Run carthage update
to build the framework and drag the built SwiftHEXColors.framework
into your Xcode project.
Manually
- Drag and drop
SwiftHEXColors.swift
file into your project
Requirements
- Swift 3
- iOS 8.0 or above.
License
*Note that all licence references and agreements mentioned in the SwiftHEXColors README section above
are relevant to that project's source code only.