AVHexColor is a class for iOS (iPhone & iPad) and OS X (Mac), inspired by the lack of hexadecimal colour integration of iOS.
Install
Recommended
Podfile
via CocoaPods
platform :ios
pod 'AVHexColor', '~> 1.1.0'
Alternatives
- Using git subtree
git subtree add --prefix=AVHexColor --squash https://github.com/anjerodesu/AVHexColor.git master
- Using git submodule
git submodule add https://github.com/anjerodesu/AVHexColor.git AVHexColor
- Download
- Copy the
AVHexColor.h
andAVHexColor.m
files and#import
the header file (AVHexColor.h
) to your project
- Copy the
Sample Usage:
self.view.backgroundColor = [AVColor colorWithHex: 0xff0000];
UIColor *randomColor = [AVColor randomColor];
Methods:
+ (AVColor *)colorWithHex:(UInt32)hexadecimal;
+ (AVColor *)colorWithHexString:(NSString *)hexadecimal;
And a lot of convenience methods…
License
AVHexColor is available under the MIT license. See the LICENSE file for more info.
Leave a Reply