#define RGB(color) \
(((color & 0xFF0000) >> 16) / 255.f), \
(((color & 0x00FF00) >> 8) / 255.f), \
(((color & 0x0000FF)) / 255.f)
Pass in an HTML-style color hex triplet. #define RGB(r,g,b) RGBA(r,g,b,1)Suggestions: you might want to allow for three-digit hex strings and eight/four digit hex strings with alpha, I found that convenient in mine. And in the documentation it would be way cool if you made the names of the colors self-referential.
Nits: I would have made all the system color methods like "systemThingColor", capitalized RGB and HSB, and made "RGBDictionary" return @{@"red": ...} (and made static NSStrings for the keys so nobody needs to go to the .m file to see what will happen). Obviously I am a pedant and I live right on the edge of the 80 character limit; of these I'd only suggest making static dictionary keys as an actually desirable change.
Nice work, you shouldn't be ashamed to share it at all.
SO handy.
In detail: http://clang.llvm.org/docs/ObjectiveCLiterals.html
For example, I ended up putting together some defines like this after building a bunch of UI programmatically.
RGB(255, 104, 0) may be a bit too C-ish, but it sure beats the long form. Have similar GRAY(x) and GRAYA(x) defines for producing grayscale colors.Definitely interested to see more projects along these lines.