Home

Awesome

Version Platform License

Random Color Objective-C

Inspired by David Merfield's randomColor.js and the Swift port by Wei Wang.

Cocoapods

pod 'randomColor'

OSX

#import <NSColor+randomColor.h>

NSColor * rand = [NSColor randomColor];

NSColor * blueRand = [NSColor randomColorWithHue:YGColorHueBlue];

NSColor* greenBright = [NSColor randomColorWithHue:YGColorHueGreen luminosity:YGColorLuminosityBright];

NSArray * tenRandom = [NSColor randomColorsWithCount:10];

NSArray * tenYellow = [NSColor randomColorsWithHue:YGColorHueYellow count:10];

iOS

#import <UIColor+randomColor.h>

UIColor * rand = [UIColor randomColor];

NSColor * blueRand = [UIColor randomColorWithHue:YGColorHueBlue];

NSColor* greenBright = [UIColor randomColorWithHue:YGColorHueGreen luminosity:YGColorLuminosityBright];

NSArray * tenRandom = [UIColor randomColorsWithCount:10];

NSArray * tenYellow = [UIColor randomColorsWithHue:YGColorHueYellow count:10];

Acknowledgements

Thanks for David Merfield bringing us randomColor.js, which is a great utility.

License

This project is licensed under the terms of the MIT license.