Converting from RGB to HSL with Objective C

treeba picture treeba · Jun 10, 2010 · Viewed 9.2k times · Source

I'm quite new to objective c but have been programming for a while. I started creating a function that would convert from RGB to HSL and back again but I get a feeling it is way too long and headed in the wrong direction. Does anyone know of a simple way to perform this conversion?

Answer

Matteo Alessani picture Matteo Alessani · Jun 8, 2011

NSColor is missing in iPhone SDK. You can use this utility to convert from RGB to HSL space and back:

https://github.com/alessani/ColorConverter