Code Monkey home page Code Monkey logo

hexcolor's Introduction

HexColor

build CocoaPods Version License visitors

A convenient way to convert hex strings to UIColor or NSColor. HexColor support RGB 、ARGB and RGBA hex strings. In addition, HexColor will cache hex color for reusing which can improve performance.

Examples

RGB hex string

let red = UIColor.hexColor("FF0000")
let green = UIColor.hexColor("#00FF00")
let blue = UIColor.hexColor("0000FF")

ARGB hex string

let aquaAlpha = UIColor.hexColor("99D4F2E7")
let yellowAlpha = UIColor.hexColor("88FFFF00")

RGBA hex string

let aquaAlpha = UIColor.hexColor("D4F2E799", type: .ARGB)
let yellowAlpha = UIColor.hexColor("FFFF0088", type: .ARGB)

Set Color cache count limit

// default is 100
UIColor.cacheCountLimit = 200

Installation

CocoaPods

pod 'IRHexColor'

Manually

Drag and drop HexColor.swift file into your project

hexcolor's People

Contributors

zhiyongzou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

karenz1 ifiee

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.