HexColor is a simple extension that lets you initialize UIColors the way they were meant to be initialized: With hex integer values

Related tags

Color HexColor
Overview

HexColor

Build Status CocoaPods Compatible Carthage Compatible License Platform Twitter

HexColor is a simple extension that lets you initialize UIColors the way they were meant to be initialized: With hex integer values.

Requirements

  • iOS 7.0 / watchOS 2.0 / tvOS 10.0
  • Xcode 9.0 (Swift 4.0)

Installation

To use HexColor with a project targeting iOS 7, simply copy HexColor.swift into your project.

CocoaPods

To integrate HexColor into your project add the following to your Podfile:

platform :ios, '8.0'
use_frameworks!

pod 'HxColor', '~> 4.0'

Carthage

To integrate Signals into your project using Carthage add the following to your Cartfile:

4.0 ">
github "artman/HexColor" ~> 4.0

Quick start

myLabel.textColor = UIColor(0xFFFFFF) // Let there be white
myView.backgroundColor = UIColor(0x0f126f) // Deep blue

// Yay, finally you can stop to use this crap:
// UIColor.colorWithRed(0x0f/255.0, green: 0x12/255.0, blue: 0x65/255.0, 1.0)

Need colors with alpha? No worries:

myLabel.textColor = UIColor(0xFF0000).alpha(0.5) // Red with 50% opacity
myLabel.textColor = UIColor(0xFF0000, alpha: 0.5) // Another way to do this

You can also mix two colors together easily:

myLabel.textColor = UIColor(0x3377FF).mix(with: 0xFF2222, amount: 0.25)

Contribute

To contribute, just fork, branch & send a pull request. To get in touch, hit me up on Twitter @artman

License

HexColor is released under an MIT license. See the LICENSE file for more information

You might also like...
Save the color of your moments. Remember your moments with colors you name.🎨
Save the color of your moments. Remember your moments with colors you name.🎨

Pixel Palette 🎨 What was the color of the sunset yesterday? Or the color you would like to use in your vlog? Save the color of your moments with Pixe

UIGradient - A simple and powerful library for using gradient layer, image, color
UIGradient - A simple and powerful library for using gradient layer, image, color

UIGradient is now available on CocoaPods. Simply add the following to your project Podfile, and you'll be good to go.

StepSlider its custom implementation of slider such as UISlider for preset integer values.
StepSlider its custom implementation of slider such as UISlider for preset integer values.

StepSlider StepSlider its custom implementation of slider such as UISlider for preset values. Behind the scenes StepSlider manipulate integer indexes.

A network extension app to block a user input URI. Meant as a network extension filter proof of concept.
A network extension app to block a user input URI. Meant as a network extension filter proof of concept.

URIBlockNE A network extension app to block a user input URI. Meant as a network extension filter proof of concept. This is just a research effort to

A tool that generate code for Swift projects, designed to improve the maintainability of UIColors
A tool that generate code for Swift projects, designed to improve the maintainability of UIColors

SwiftColorGen A tool that generate code for Swift projects, designed to improve the maintainability of UIColors. Please notice, this tool still under

HEX color handling as an extension for UIColor. Written in Swift.

SwiftHEXColors HEX color handling as an extension for UIColor. Written in Swift.

HEX color handling as an extension for UIColor

HEX color handling as an extension for UIColor. Written in Swift

An Integer type that clamps its value to its minimum and maximum instead of over- or underflowing.

ClampedInteger An Integer type that clamps its value to its minimum and maximum instead of over- or underflowing. Examples let big = ClampedIntege

This package is meant to make http request of an easy way inspiren in the architecture of Moya package

NetworkAgent This package is meant to make http request of an easy way inspiren in the architecture of Moya package. This package is 100% free of depe

JSONHelper - ✌ Convert anything into anything in one operation; JSON data into class instances, hex strings into UIColor/NSColor, y/n strings to booleans, arrays and dictionaries of these; anything you can make sense of!

JSONHelper Convert anything into anything in one operation; hex strings into UIColor/NSColor, JSON strings into class instances, y/n strings to boolea

ColorAssetsFinder can help you find particular color assets easily by hex color code.
ColorAssetsFinder can help you find particular color assets easily by hex color code.

ColorAssetsFinder ColorAssetsFinder can help you find particular color assets easily by hex color code. Features Find particular color assets in Asset

A pure Swift library that allows you to easily convert SwiftUI Colors to Hex String and vice versa.
A pure Swift library that allows you to easily convert SwiftUI Colors to Hex String and vice versa.

iOS · macOS · watchOS · tvOS A pure Swift library that allows you to easily convert SwiftUI Colors to Hex String and vice versa. There is also support

A simple UIColor category to get color with hex code.
A simple UIColor category to get color with hex code.

TFTColor A simple UIColor library to get UIColor object from RGB hex string/value, CMYK hex string/value or CMYK base component values. You can also r

How Swift standard types and classes were supposed to work.
How Swift standard types and classes were supposed to work.

How Swift standard types and classes were supposed to work. A collection of useful extensions for the Swift Standard Library, Foundation, and UIKit.

A protocol that allows any class to be printed as if it were a struct or a JSON object.

ReflectedStringConvertible A protocol that extends CustomStringConvertible and uses reflection to add a detailed textual representation to any class.

Android/iOS Apps created to practice with different iOS/Android Tech. These apps were built to have similar feature sets using native Android/iOS.

AgilityFitTodayApp Android/iOS Apps created to practice with different iOS/Android Tech. These apps were built to have similar feature sets using nati

PiPifier - a macOS and iOS Safari extension that lets you use every HTML5 video in Picture in Picture mode
PiPifier - a macOS and iOS Safari extension that lets you use every HTML5 video in Picture in Picture mode

PiPifier is a macOS 10.12 and iOS Safari (action) extension that lets you use every HTML5 video in Picture in Picture mode macOS Download It'

Comments
  • Correct the spelling of CocoaPods in README

    Correct the spelling of CocoaPods in README

    This pull requests corrects the spelling of CocoaPods 🤓 https://github.com/CocoaPods/shared_resources/tree/master/media

    Created with cocoapods-readme.

    opened by ReadmeCritic 2
  • Build failed by carthage

    Build failed by carthage

    Xcode 7.3.1 & carthage 0.18

    *** Building scheme "HexColor" in HexColor.xcodeproj
    ** CLEAN FAILED **
    
    
    The following build commands failed:
        Check dependencies
    (1 failure)
    ** BUILD FAILED **
    
    
    The following build commands failed:
        Check dependencies
    (1 failure)
    A shell task (/usr/bin/xcrun xcodebuild -project /Users/zhuxuhong/Desktop/CarthageDemo/CarthageDemo/Carthage/Checkouts/HexColor/HexColor.xcodeproj -scheme HexColor -configuration Release -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build) failed with exit code 65:
    ** CLEAN FAILED **
    
    opened by BackWorld 0
Releases(4.0.0)
Owner
Tuomas Artman
Co-founder @ Linear. Previously staff engineer @ Uber
Tuomas Artman
HEX color handling as an extension for UIColor

HEX color handling as an extension for UIColor. Written in Swift

Thi Doãn 692 Dec 22, 2022
A pure Swift library that allows you to easily convert SwiftUI Colors to Hex String and vice versa.

iOS · macOS · watchOS · tvOS A pure Swift library that allows you to easily convert SwiftUI Colors to Hex String and vice versa. There is also support

Novem 3 Nov 20, 2022
A simple UIColor category to get color with hex code.

TFTColor A simple UIColor library to get UIColor object from RGB hex string/value, CMYK hex string/value or CMYK base component values. You can also r

Burhanuddin Sunelwala 18 Jun 21, 2022
Convenience methods for creating color using RGBA hex string.

UIColor+Hex, now Swift. Convenience method for creating autoreleased color using RGBA hex string.

R0CKSTAR 1.2k Dec 23, 2022
iOS app for Technex, IIT(BHU) Varanasi. This project is closed before completion. You can use this app for learning purpose. You can use this app as a templet of any event related app.

technex-ios iOS app for Technex, IIT(BHU) Varanasi. This project is closed before completion for some reasons. You can use this app for learning purpo

Jogendra 12 May 9, 2022
Yet another extension to manipulate colors easily in Swift and SwiftUI

DynamicColor provides powerful methods to manipulate colors in an easy way in Swift and SwiftUI. Requirements • Usage • Installation • Contribution •

Yannick Loriot 2.8k Dec 30, 2022
All wikipedia colors implemented as easy to use UIColor extension 🌈

UIColor-WikiColors All wikipedia colors implemented as an easy to use UIColor extension. Have you ever tried using UIColor.lightBlue just to be welcom

Szymon Maślanka 58 Jul 30, 2022
A UIColor extension with CSS3 Color names.

CSS3ColorsSwift Overview CSS3ColorsSwift provides a UIColor extension with Web Color names. Demo Run the demo project in the Demo directory without ca

WorldDownTown 67 Aug 6, 2022
Hue is the all-in-one coloring utility that you'll ever need.

Hue is the all-in-one coloring utility that you'll ever need. Usage Hex You can easily use hex colors with the init(hex:) convenience initializer on U

Christoffer Winterkvist 3.4k Jan 3, 2023
Hue is the all-in-one coloring utility that you'll ever need

Hue is the all-in-one coloring utility that you'll ever need. Usage Hex You can easily use hex colors with the init(hex:) convenience initializer on U

Christoffer Winterkvist 3.4k Jan 3, 2023