MCUIColorUtils 1.0.0

MCUIColorUtils 1.0.0

测试已测试
语言 Obj-CObjective C
许可证 BSD 3.0
发布上次发布2014年12月

Mirego维护。



  • 作者:
  • Mirego

MCUIColorUtils - UIColor缺少的方法。

MCUIColorUtils扩展了UIColor以添加一些方便的方法。

使用

#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
}

添加到您的项目中

如果您正在使用CocoaPods,那么这很简单。将以下内容添加到您的Podfile中,并运行pod install

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

不要忘记在需要的地方导入#import "UIColor+MCUIColorsUtils.h"

许可证

MCUIColorUtils是© 2013 Mirego,并且可以在新BSD许可下自由分发。请参阅LICENSE.md文件。

关于Mirego

Mirego是一支充满激情的团队,他们相信工作是一个您可以创新和玩乐的地方。我们自豪地为iPhoneiPadAndroidBlackBerryWindows PhoneWindows 8开发了移动应用程序。了解更多关于我们团队的信息,请访问life.mirego.com