Latest 2.0.0
Homepage https://github.com/hsluv/hsluv-objc
License MIT
Platforms ios 6.0, osx 10.7, requires ARC
Authors ,

Cocoapod compatible
Build Status

Objective-C port of HSLuv.

Which files are needed?

If you’re using CocoaPods just add pod 'hsluv-objc' to your Podfile.

Otherwise, include this files in your project:

  • hsluv-objc.h
  • hsluv-objc+Tests.h
  • hsluv-objc.c

How to use

Import hsluv-objc.h, which defines the following functions:

// Accepts red, green and blue values between 0 and 1, returns the color in hex format, as in "#012C4A"
NSString *rgbToHex(CGFloat red, CGFloat green, CGFloat blue);

// Accepts an hex color, as in "#012C4A", and stores its red, green and blue components with values between 0 and 1.
BOOL hexToRgb(NSString *hex, CGFloat *red, CGFloat *green, CGFloat *blue);

// Hue is a value between 0 and 360, saturation and lightness between 0 and 100. Stores the RGB in values between 0 and 1.
void hsluvToRgb(CGFloat hue, CGFloat saturation, CGFloat lightness, CGFloat *red, CGFloat *green, CGFloat *blue);

// Red, green and blue values between 0 and 1, stores the hsluv components with hue between 0 and 360, saturation and lightness between 0 and 100.
void rgbToHsluv(CGFloat red, CGFloat green, CGFloat blue, CGFloat *hue, CGFloat *saturation, CGFloat *lightness);

// Hue is a value between 0 and 360, saturation and lightness between 0 and 100. Stores the RGB in values between 0 and 1.
void hpluvToRgb(CGFloat hue, CGFloat saturation, CGFloat lightness, CGFloat *red, CGFloat *green, CGFloat *blue);

// Red, green and blue values between 0 and 1, stores the hpluv components with hue between 0 and 360, saturation and lightness between 0 and 100.
void rgbToHpluv(CGFloat red, CGFloat green, CGFloat blue, CGFloat *hue, CGFloat *saturation, CGFloat *lightness);

Latest podspec

{
    "name": "hsluv-objc",
    "version": "2.0.0",
    "summary": "HSLuv is a human-friendly alternative to HSL.",
    "description": "CIELUV is a color space designed for perceptual uniformity based on human experiments. When accessed by polar coordinates, it becomes functionally similar to HSL with a single problem: its chroma component doesn't fit into a specific range.nnHSLuv extends CIELUV with a new saturation component that allows you to span all the available chroma as a neat percentage.",
    "homepage": "https://github.com/hsluv/hsluv-objc",
    "license": {
        "type": "MIT",
        "file": "LICENSE.txt"
    },
    "authors": {
        "Alexei Boronine": "[email protected]",
        "Roger Tallada": "[email protected]"
    },
    "platforms": {
        "ios": "6.0",
        "osx": "10.7"
    },
    "source": {
        "git": "https://github.com/hsluv/hsluv-objc.git",
        "tag": "2.0.0"
    },
    "source_files": [
        "hsluv-objc",
        "hsluv-objc/**/*.{h,m}"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This