[翻译] UIColor-uiGradientsAdditions

UIColor-uiGradientsAdditions

https://github.com/kaiinui/UIColor-uiGradientsAdditions

 

 

Beautiful colors from http://uigradients.com/

优雅的渐变色效果,来自于 http://uigradients.com/

 

Usage

UIColor *startColor = [UIColor uig_emeraldWaterStartColor];
UIColor *endColor = [UIColor uig_emeraldWaterEndColor];

CAGradientLayer *gradient = [CAGradientLayer layer];
gradient.frame = view.bounds;
gradient.startPoint = CGPointMake(0, 0);
gradient.endPoint = CGPointMake(view.frame.size.width, 0); gradient.colors = @[(id)[startColor CGColor], (id)[endColor CGColor], nil]; [view.layer insertSublayer:gradient atIndex:0];

You can pick a color from various preset colors!

你可以从这些预设的渐变色中挑选出你喜欢的!

 

Installation

pod 'UIColor+uiGradients'

To inspect colors, I recommend to use ColorSense-for-Xcode.

Or see http://uigradients.com/

用pod直接安装'UIColor+uiGradients'

为了实时体验不同颜色,我建议使用插件 ColorSense-for-Xcode.或者从网站 http://uigradients.com/ 查看对应的效果。

 

 

The list of colors

# pragma mark - Emerald Water

+ (UIColor *)uig_emeraldWaterStartColor;
+ (UIColor *)uig_emeraldWaterEndColor;

# pragma mark - Lemon Twist

+ (UIColor *)uig_lemonTwistStartColor;
+ (UIColor *)uig_lemonTwistEndColor;

# pragma mark - Horizon

+ (UIColor *)uig_horizonStartColor;
+ (UIColor *)uig_horizonEndColor;

# pragma mark - Rose Water

+ (UIColor *)uig_roseWaterStartColor;
+ (UIColor *)uig_roseWaterEndColor;

# pragma mark - Frozen

+ (UIColor *)uig_frozenStartColor;
+ (UIColor *)uig_frozenEndColor;

# pragma mark - Mango Pulp + (UIColor *)uig_mangoPulpStartColor; + (UIColor *)uig_mangoPulpEndColor; # pragma mark - Bloody Mary + (UIColor *)uig_bloodyMaryStartColor; + (UIColor *)uig_bloodyMaryEndColor; # pragma mark - Aubergine + (UIColor *)uig_aubergineStartColor; + (UIColor *)uig_aubergineEndColor; # pragma mark - Aqua Marine + (UIColor *)uig_aquaMarineStartColor; + (UIColor *)uig_aquaMarineEndColor; # pragma mark - Sunrise + (UIColor *)uig_sunriseStartColor; + (UIColor *)uig_sunriseEndColor; # pragma mark - Purple Paradise + (UIColor *)uig_purpleParadiseStartColor; + (UIColor *)uig_purpleParadiseEndColor; # pragma mark - Sea Weed + (UIColor *)uig_seaWeedStartColor; + (UIColor *)uig_seaWeedEndColor; # pragma mark - Pinky + (UIColor *)uig_pinkyStartColor; + (UIColor *)uig_pinkyEndColor; # pragma mark - Cherry + (UIColor *)uig_cherryStartColor; + (UIColor *)uig_cherryEndColor; # pragma mark - Mojito + (UIColor *)uig_mojitoStartColor; + (UIColor *)uig_mojitoEndColor; # pragma mark - Juicy Orange + (UIColor *)uig_juicyOrangeStartColor; + (UIColor *)uig_juicyOrangeEndColor; # pragma mark - Mirage + (UIColor *)uig_mirageStartColor; + (UIColor *)uig_mirageEndColor; # pragma mark - Steel Gray + (UIColor *)uig_steelGrayStartColor; + (UIColor *)uig_steelGrayEndColor; # pragma mark - Kashmir + (UIColor *)uig_kashmirStartColor; + (UIColor *)uig_kashmirEndColor; # pragma mark - Electric Violet + (UIColor *)uig_electricVioletStartColor; + (UIColor *)uig_electricVioletEndColor; # pragma mark - Venice Blue + (UIColor *)uig_veniceBlueStartColor; + (UIColor *)uig_veniceBlueEndColor; # pragma mark - Bora Bora + (UIColor *)uig_boraBoraStartColor; + (UIColor *)uig_boraBoraEndColor; # pragma mark - Moss + (UIColor *)uig_mossStartColor; + (UIColor *)uig_mossEndColor; # pragma mark - Shroom Haze + (UIColor *)uig_shroomHazeStartColor; + (UIColor *)uig_shroomHazeEndColor; # pragma mark - Mystic + (UIColor *)uig_mysticStartColor; + (UIColor *)uig_mysticEndColor; # pragma mark - Midnight City + (UIColor *)uig_midnightCityStartColor; + (UIColor *)uig_midnightCityEndColor; # pragma mark - Sea Blizz + (UIColor *)uig_seaBlizzStartColor; + (UIColor *)uig_seaBlizzEndColor; # pragma mark - Opa + (UIColor *)uig_opaStartColor; + (UIColor *)uig_opaEndColor; # pragma mark - Titanium + (UIColor *)uig_titaniumStartColor; + (UIColor *)uig_titaniumEndColor; # pragma mark - Mantle + (UIColor *)uig_mantleStartColor; + (UIColor *)uig_mantleEndColor; # pragma mark - Dracula + (UIColor *)uig_draculaStartColor; + (UIColor *)uig_draculaEndColor; # pragma mark - Peach + (UIColor *)uig_peachStartColor; + (UIColor *)uig_peachEndColor; # pragma mark - Moonrise + (UIColor *)uig_moonriseStartColor; + (UIColor *)uig_moonriseEndColor; # pragma mark - Clouds + (UIColor *)uig_cloudsStartColor; + (UIColor *)uig_cloudsEndColor; # pragma mark - Stellar + (UIColor *)uig_stellarStartColor; + (UIColor *)uig_stellarEndColor; # pragma mark - Bourbon + (UIColor *)uig_bourbonStartColor; + (UIColor *)uig_bourbonEndColor; # pragma mark - Calm Darya + (UIColor *)uig_calmDaryaStartColor; + (UIColor *)uig_calmDaryaEndColor; # pragma mark - Influenza + (UIColor *)uig_influenzaStartColor; + (UIColor *)uig_influenzaEndColor; # pragma mark - Shrimpy + (UIColor *)uig_shrimpyStartColor; + (UIColor *)uig_shrimpyEndColor; # pragma mark - Army + (UIColor *)uig_armyStartColor; + (UIColor *)uig_armyEndColor; # pragma mark - Miaka + (UIColor *)uig_miakaStartColor; + (UIColor *)uig_miakaEndColor; # pragma mark - Pinot Noir + (UIColor *)uig_pinotNoirStartColor; + (UIColor *)uig_pinotNoirEndColor; # pragma mark - Day Tripper + (UIColor *)uig_dayTripperStartColor; + (UIColor *)uig_dayTripperEndColor; # pragma mark - Namn + (UIColor *)uig_namnStartColor; + (UIColor *)uig_namnEndColor; # pragma mark - Blurry Beach + (UIColor *)uig_blurryBeachStartColor; + (UIColor *)uig_blurryBeachEndColor; # pragma mark - Vasily + (UIColor *)uig_vasilyStartColor; + (UIColor *)uig_vasilyEndColor; # pragma mark - A Lost Memory + (UIColor *)uig_aLostMemoryStartColor; + (UIColor *)uig_aLostMemoryEndColor; # pragma mark - Petrichor + (UIColor *)uig_petrichorStartColor; + (UIColor *)uig_petrichorEndColor; # pragma mark - Jonquil + (UIColor *)uig_jonquilStartColor; + (UIColor *)uig_jonquilEndColor; # pragma mark - Sirius Tamed + (UIColor *)uig_siriusTamedStartColor; + (UIColor *)uig_siriusTamedEndColor; # pragma mark - Kyoto + (UIColor *)uig_kyotoStartColor; + (UIColor *)uig_kyotoEndColor; # pragma mark - Misty Meadow + (UIColor *)uig_mistyMeadowStartColor; + (UIColor *)uig_mistyMeadowEndColor; # pragma mark - Aqualicious + (UIColor *)uig_aqualiciousStartColor; + (UIColor *)uig_aqualiciousEndColor; # pragma mark - Moor + (UIColor *)uig_moorStartColor; + (UIColor *)uig_moorEndColor; # pragma mark - Almost + (UIColor *)uig_almostStartColor; + (UIColor *)uig_almostEndColor; # pragma mark - Forever Lost + (UIColor *)uig_foreverLostStartColor; + (UIColor *)uig_foreverLostEndColor; # pragma mark - Winter + (UIColor *)uig_winterStartColor; + (UIColor *)uig_winterEndColor; # pragma mark - Autumn + (UIColor *)uig_autumnStartColor; + (UIColor *)uig_autumnEndColor; # pragma mark - Candy + (UIColor *)uig_candyStartColor; + (UIColor *)uig_candyEndColor; # pragma mark - Reef + (UIColor *)uig_reefStartColor; + (UIColor *)uig_reefEndColor; # pragma mark - The Strain + (UIColor *)uig_theStrainStartColor; + (UIColor *)uig_theStrainEndColor; # pragma mark - Dirty Fog + (UIColor *)uig_dirtyFogStartColor; + (UIColor *)uig_dirtyFogEndColor; # pragma mark - Earthly + (UIColor *)uig_earthlyStartColor; + (UIColor *)uig_earthlyEndColor; # pragma mark - Virgin + (UIColor *)uig_virginStartColor; + (UIColor *)uig_virginEndColor; # pragma mark - Ash + (UIColor *)uig_ashStartColor; + (UIColor *)uig_ashEndColor; # pragma mark - Shadow Night + (UIColor *)uig_shadowNightStartColor; + (UIColor *)uig_shadowNightEndColor; # pragma mark - Cherryblossoms + (UIColor *)uig_cherryblossomsStartColor; + (UIColor *)uig_cherryblossomsEndColor; # pragma mark - Parklife + (UIColor *)uig_parklifeStartColor; + (UIColor *)uig_parklifeEndColor; # pragma mark - Dance To Forget + (UIColor *)uig_danceToForgetStartColor; + (UIColor *)uig_danceToForgetEndColor; # pragma mark - Starfall + (UIColor *)uig_starfallStartColor; + (UIColor *)uig_starfallEndColor; # pragma mark - Red Mist + (UIColor *)uig_redMistStartColor; + (UIColor *)uig_redMistEndColor; # pragma mark - Teal Love + (UIColor *)uig_tealLoveStartColor; + (UIColor *)uig_tealLoveEndColor; # pragma mark - Neon Life + (UIColor *)uig_neonLifeStartColor; + (UIColor *)uig_neonLifeEndColor; # pragma mark - Man of Steel + (UIColor *)uig_manofSteelStartColor; + (UIColor *)uig_manofSteelEndColor; # pragma mark - Amethyst + (UIColor *)uig_amethystStartColor; + (UIColor *)uig_amethystEndColor; # pragma mark - Cheer Up Emo Kid + (UIColor *)uig_cheerUpEmoKidStartColor; + (UIColor *)uig_cheerUpEmoKidEndColor; # pragma mark - Shore + (UIColor *)uig_shoreStartColor; + (UIColor *)uig_shoreEndColor; # pragma mark - Facebook Messenger + (UIColor *)uig_facebookMessengerStartColor; + (UIColor *)uig_facebookMessengerEndColor; # pragma mark - SoundCloud + (UIColor *)uig_soundCloudStartColor; + (UIColor *)uig_soundCloudEndColor; # pragma mark - Behongo + (UIColor *)uig_behongoStartColor; + (UIColor *)uig_behongoEndColor;

 

Build latest one

Just clone and

curl https://raw.githubusercontent.com/Ghosh/uiGradients/master/gradients.json | ruby parse.rb

 

LICENSE

I do not claim any rights about the code. See https://github.com/Ghosh/uiGradients for LICENSE information. (uiGradients is MIT License!)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值