CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

MCUIColorUtils 1.0.0

MCUIColorUtils 1.0.0

TestsTested
LangLanguage Obj-CObjective C
License BSD 3.0
ReleasedLast Release Dec 2014

Maintained by Mirego.



  • By
  • Mirego

MCUIColorUtils - UIColor missing methods.

MCUIColorUtils extends UIColor to add some convenience methods.

Using

#import "UIColor+MCUIColorsUtils.h"

- (void)funWithColors
{

  // Use colors straight from the web
  [UIColor colorForHex:@"#fafbfc"];

  // ... if you prefer you can go with bytes
  [UIColor colorWithHexRGB:0xfafbfc];
  [UIColor colorWithHexRGBA:0xfafbfcff];

  // ...or with 0-255 values
  [UIColor colorWithIntegerRed:250 green:251 blue:252];
  [UIColor colorWithIntegerRed:250 green:251 blue:252 alpha:255];

  // ...or if all the channels are the same
  [UIColor colorWithGray:0.980392157]; // 250/255=0.980392157
  [UIColor colorWithIntegerGray:250];  // #fafafa

  // Get a lighter color
  UIColor color* = [UIColor colorForHex:@"#123456"];
  [color colorWithMultiplier:1.10]; // 110% of rgb channels

  // ... or a darker color
  [color colorWithMultiplier:0.90]; // 90% of rgb channels
}

Adding to your project

If you're using CocoaPods, there's nothing simpler. Add the following to your Podfile and run pod install

pod 'MCUIColorUtils', :git => 'https://github.com/mirego/MCUIColorUtils.git'

Don't forget to #import "UIColor+MCUIColorsUtils.h" where it's needed.

License

MCUIColorUtils is © 2013 Mirego and may be freely distributed under the New BSD license. See the LICENSE.md file.

About Mirego

Mirego is a team of passionate people who believe that work is a place where you can innovate and have fun. We proudly built mobile applications for iPhone, iPad, Android, Blackberry, Windows Phone and Windows 8. Learn more about our team at life.mirego.com.