• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

bfeher/BFPaperColors: Flat colors taken from Google's Paper Material Design. ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

bfeher/BFPaperColors

开源软件地址(OpenSource Url):

https://github.com/bfeher/BFPaperColors

开源编程语言(OpenSource Language):

Objective-C 99.1%

开源软件介绍(OpenSource Introduction):

BFPaperColors

CocoaPods

Flat colors taken from Google's Material Design: Paper.

Screenshot

Blue Detail

About

UIColor+BFPaperColors is a category for UIColor that adds class methods to conveniently produce over 240 new colors designed for flat or semi-flat interface designs by Google's Material Design Labs.

Changes

Please refer to this CHANGELOG.md.

Usage

Add the UIColor+BFPaperColors header and implementation file to your project. (.h & .m)

After doing that, it is a simple as calling:[UIColor paperColorXXXXX] (where XXXXX is the color of your choice). Each paper color method is prefixed with the words "paperColor" for easy recognition in Xcode's code complete. All colors have a wide range of shades, noted by a number suffix. For example, A very light blue could be [UIColor paperColorLightBlue100] while a darker shade could be [UIColor paperColorLightBlue700].

Working Example

view.backgroundColor = [UIColor paperColorCyan600];

Utility Macro and Functions

UIColorFromRGB(rgbValue)

Returns a UIColor from a given hex-code.

@param rgbValue The hex-code to use to get a UIColor. ex: 0xffffff
@return A UIColor object of the color of the passed in hex-code.


+ (BOOL)isColorClear:(UIColor *)color

Returns a BOOL indicating whether or not the color passed to this function is clear or not.

@param color The UIColor to test.
@return YES if clear, NO if not clear.


+ (BOOL)isColorDark:(UIColor *)color;

Returns a BOOL indicating whether or not the color passed to this function is dark or not.

@param color The UIColor to test.
@return YES if dark, NO if not dark.


+ (BOOL)isColorLight:(UIColor *)color;

Returns a BOOL indicating whether or not the color passed to this function is light or not.

@param color The UIColor to test.
@return YES if light, NO if not light.


+ (UIImage *)imageFromColor:(UIColor *)color

Returns a UIImage generated by a color. (Useful for setting button background images for states that are a solid color.)

@param color The color to create an image out of.
@return A UIImage of the passed color.


+ (NSString *)hexStringFromRGBColor:(UIColor *)color

Returns the hex-code representation of a UIColor.

@param color The color to inspect for its hex-code.
@return An NSString representing the hex-code of the passed in color.


+ (CAGradientLayer *)gradientWithStartColor:(UIColor *)startColor endColor:(UIColor *)endColor

Returns a simple gradient layer built from two colors.

@param startColor A UIColor to use as the start color of the gradient layer.
@param endColor A UIColor to use as the end color of the gradient layer.
@return A CAGradientLayer starting with the startColor and ending with the endColor.

CocoaPods

CocoaPods are the best way to manage library dependencies in Objective-C projects. Learn more at http://cocoapods.org

Add this to your podfile to add the UIColor+BFPaperColors category to your project.

platform :ios, '7.0'
pod 'UIColor+BFPaperColors'

License

UIColor+BFPaperColors uses the MIT License:

Please see included LICENSE file.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap