Coder Social home page Coder Social logo

colorwithhsl-ios's Introduction

ColorWithHSL-iOS

Version License Platform CocoaPods Build Status

What is it?

Swift Extension to convert a HSL colour values into a UIColor Objects.

HSL stands for hue, saturation, and lightness, and is also often called HLS.

Formula from Wikipedia.

Installation

Podfile

platform :ios, '8.0'
use_frameworks!

pod 'ColorWithHSL', '~> 0.0'

Then, run the following command:

$ pod install

Old school

Drag into your project the folder /ColorWithHSL-iOS. That's all.

Example Swift

        let black: UIColor = UIColor.colorWithHSL(hue: 0.0, saturation: 0.0, lightness: 0.0)
        let white: UIColor = UIColor.colorWithHSL(hue: 0.0, saturation: 0.0, lightness: 1.0)
        let red: UIColor = UIColor.colorWithHSL(hue: 0.0, saturation: 1.0, lightness: 0.5)
        let green: UIColor = UIColor.colorWithHSL(hue: 120.0, saturation: 1.0, lightness: 0.5)
        let blue: UIColor = UIColor.colorWithHSL(hue: 240.0, saturation: 1.0, lightness: 0.5)

Example Objective-C

#import "ColorWithHSL-Swift.h"

...
    UIColor *black = [UIColor hsl_colorWithHue:0.0 saturation:0.0 lightness:0.0];
    UIColor *white = [UIColor hsl_colorWithHue:0.0 saturation:0.0 lightness:1.0];
    UIColor *red = [UIColor hsl_colorWithHue:0.0 saturation:1.0 lightness:0.5];
    UIColor *green = [UIColor hsl_colorWithHue:120.0 saturation:1.0 lightness:0.5];
    UIColor *blue = [UIColor hsl_colorWithHue:240.0 saturation:1.0 lightness:0.5];
    
        

License

ColorWithHSL-iOS is released under the MIT license. Please see the file called LICENSE.

Versions

$ git tag -a 1.0.0 -m 'Version 1.0.0'

$ git push --tags

Author

Gabriel Massana

##Found an issue?

Please open a new Issue here if you run into a problem specific to ColorWithHSL-iOS, have a feature request, or want to share a comment.

colorwithhsl-ios's People

Contributors

gabrielmassana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.