Popularity
1.2
Stable
Activity
0.0
Stable
24
3
7

Code Quality Rank: L5
Programming language: Swift
License: MIT License
Tags: Color    
Latest version: v3.0.0

PFColorHash alternatives and similar libraries

Based on the "Color" category.
Alternatively, view PFColorHash alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of PFColorHash or a related project?

Add another 'Color' Library

README

PFColorHash

Cocoapods

Swift 4.0 SUPPORT!

Generate color based on the given string. Thanks to color-hash.

[Sample](Sample.gif)

Usage

Basic

let colorHash = PFColorHash()

// in HSL, Hue โˆˆ [0, 360), Saturation โˆˆ [0, 1], Lightness โˆˆ [0, 1]
colorHash.hsl('Hello World') // [ 225, 0.65, 0.35 ]

// in RGB, R, G, B โˆˆ [0, 255]
colorHash.rgb('Hello World') // [ 134, 150, 196 ]

// in HEX
colorHash.hex('Hello World') // '#8696c4'

Custom Hash Function / Lightness / Saturation

let colorHash = PFColorHash(hash: { (str: String) -> Int64 in
    var hashValue: Int64 = 0
    // Your Hash Function Here
    return hashValue
})
let colorHash = PFColorHash(lightness: [0.35, 0.5, 0.65])
let colorHash = PFColorHash(saturation: [0.35, 0.5, 0.65])
let colorHash = PFColorHash(lightness: [0.35, 0.5, 0.65], saturation: [0.35, 0.5, 0.65])

License

Released under the MIT License.


*Note that all licence references and agreements mentioned in the PFColorHash README section above are relevant to that project's source code only.