Giter VIP home page Giter VIP logo

colors's Introduction

Colors

License Swift Carthage compatible

Installation

Carthage

github "dylan/colors"

Cocoapods

Not supported. It's too convoluted.

Coming Soon...

  • Perceptual functions - What colors can work when viewed with other's and in certain situations?
  • Harmonic functions - Inverse, Triadic, Analogous, etc.

Usage

import Colors

let color1 = Color(red: 1.0, green: 1.0, blue: 1.0)

let color2 = Color(redInt: 255, greenInt: 255, blueInt: 255)

let color3 = Color(hex: 0xffffff)


color1 == color2 // true
color2 == color3 // true


var dinerGreen = Color(hex: 0x37ecbd)

dinerGreen.hsl.hue        // 164.4199
dinerGreen.hsl.saturation // 0.826484
dinerGreen.hsl.lightness  // 0.5705882

dinerGreen.rgb.red   // 0.2156863
dinerGreen.rgb.green // 0.9254902
dinerGreen.rgb.blue  // 0.7411765

dinerGreen.hex       // 4281855165
dinerGreen.hexString // "#37ecbd"

dinerGreen.hueShifted(45).view  // On iOS/Mac a View with a soft blue square.


/// Colors also has a few color lists available...

Resene.copperFire // #915345

XKCD.acidgreen    // #8ffe09

X11.all.count     // 140

colors's People

Contributors

aure avatar dylan avatar phlebotinum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

colors's Issues

HSV to HSL can cause S to become NaN

to reproduce:

 let colorHSV = Color(hue: 0.0, saturation: 0.0, value: 100.0)
 let colorConvertedHSL = colorHSV.converted(to: .hsl)
 print("saturation:", colorConvertedHSL.hsl.saturation)
// saturation: nan

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.