GithubHelp home page GithubHelp logo

jaumevn / xcolor Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 36 KB

XColor is a color handling extension for UIColor written in Swift.

License: MIT License

Swift 92.17% Objective-C 3.25% Ruby 4.58%
color ios swift hex hexadecimal uicolor xcode xcolor

xcolor's Introduction

Build Status codecov Carthage Compatible Cocoapods Cocoapods platforms GitHub

XColor

XColor is a color handling extension for UIColor written in Swift.

Examples

XColor supports alpha channel with implicit and explicit convenience initializers:

// Set alpha with 8 character representation
let colorAlphaString = UIColor("#5F7EFB50")

// Set alpha channel with explicit convenience init
let colorAlphaExplicit = UIColor("#5F7EFB", alpha: 0.5)

You can use multiple character representations:

// 3 character representation
let color3CharString = UIColor("#57F")

// 6 character representation
let color6CharString = UIColor("#5F7EFB")

// 8 character representation (alpha channel)
let color8CharString = UIColor("#5F7EFB50")

Define your colors with hex string or number:

// Create solid colors with hex string or hex number
let colorString = UIColor("#5F7EFB")
let colorNumber = UIColor(0xFF3033)

Installation

Cocapods

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate XColor into your Xcode project using CocoaPods, specify it in your Podfile:

pod "XColor"

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate XColor into your Xcode project using Carthage, specify it in your Cartfile:

github "jaumevn/XColor"

Requirements

  • iOS 8.0+
  • Xcode 10.2+
  • Swift 5+

Credits

XColor is owned and maintained by Jaume Viñas Navas

License

XColor is released under the MIT license. See LICENSE for details.

xcolor's People

Contributors

jaumevn avatar

Stargazers

 avatar

Watchers

 avatar  avatar

xcolor's Issues

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.