[翻译] 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!)

时间: 2024-11-29 08:13:49

[翻译] UIColor-uiGradientsAdditions的相关文章

关于自定义毛玻璃的随笔(三方使用的翻译)

写项目登录页面的背景图的时候, 要用到毛玻璃, 想要的效果是这样的: 于是我用系统提供的毛玻璃的方法写了出来: UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]; UIVisualEffectView *visualView = [[UIVisualEffectView alloc] initWithEffect:effect]; visualView.frame = [[UIScreen ma

[翻译] snapshotViewAfterScreenUpdates

snapshotViewAfterScreenUpdates This method very efficiently captures the current rendered appearance of a view and uses it to build a new snapshot view. You can use the returned view as a visual stand-in for the current view in your app. For example,

[iOS翻译]《iOS 7 Programming Cookbook》:iOS文件与文件夹管理(上)

简介: iOS基于OS X,而OSX本身基于Unix操作系统.在iOS里面,操作系统的完全路径结构是不可见的,因为每个APP的数据都存储自身的沙盒里面.沙盒环境实际上听起来像这样:一个只允许当前APP访问的文件夹目录.每个APP都有自身的沙盒文件夹,并且沙盒文件夹下的子文件夹只有当前APP能够访问. 当一个iOS APP在设备上安装后,系统为其创建的文件夹结构如下: XXX.app 即Main Bundle Documents/ 存储用户创建的内容 Library/ 存储缓存文件.偏好设置等等

[翻译] DBCamera 轻量级定制摄像头

DBCamera 轻量级定制摄像头 https://github.com/danielebogo/DBCamera DBCamera is a simple custom camera with AVFoundation. DBCamera使用了AVFoundation框架并简单的定制了摄像头. Getting Started Installation The recommended approach for installating DBCamera is via the CocoaPods

[翻译] GMCPagingScrollView

GMCPagingScrollView https://github.com/GalacticMegacorp/GMCPagingScrollView GMCPagingScrollView is a UIView containing a horizontally scrolling paging UIScrollView that supports page preloading, page dequeueing, and infinite scrolling. GMCPagingScrol

在GlassFish应用服务器上创建并运行你的第一个Restful Web Service【翻译】

前言 本人一直开发Android应用,目前Android就业形势恶劣,甚至会一路下滑,因此决定学习服务器开发.采用的语言是java,IDE是Intellij,在下载Intellij的同时看到官网很多优秀的guide文章,于是按照guide成功完成了一个RESTful的demo.官方文档非常简洁,给我带来了很大的帮助,于是翻译之,希望对其他不愿意看原文的人有所帮助.由于水平有限,读者发现错误请指正,谢谢. 原文地址: https://www.jetbrains.com/help/idea/2016

Java 7 Concurrency Cookbook 翻译 序言

在日常的Java代码开发过程中,很难免地有对多线程的需求,掌握java多线程和并发的机制也是Java程序员写出更健壮和高效代码的基础.笔者找寻国内已出版的关于Java多线程和并发的的中文书籍和翻译书籍,大家一致推荐的是<Java Concurrency in Practice>,笔者暂时还没有看英文原版,笔者看的是它的翻译版<Java并发编程实战>,笔者读起来感觉并不通畅,不知道是翻译的问题还是原版本来就写得不够流畅,同时感觉知识的深度也超过了入门的需求. 笔者在机缘巧合之下,发现

[翻译] ORMLite document -- How to Use Part (二)

前言 此文档翻译于第一次学习 ORMLite 框架,如果发现当中有什么不对的地方,请指正.若翻译与原文档出现任何的不相符,请以原文档为准.原则上建议学习原英文文档. ---------------------------------------------------------------------------------------------- 二.如何使用 2.7 表的创建 ORMLite 提供了一些工具类为您存储在数据库中的类创建 table 和 schema. 2.7.1 Tabl

Reveal常用技巧(翻译来自Reveal官网blog)

翻译来自官网:http://revealapp.com/blog/reveal-common-tips-cn.html 以下基于Reveal 1.6. 用于快速上手的内置应用 刚刚下载Reveal,啥都还没配置呢,想先随便玩玩看,怎么办? 我们花了不少时间开发这个复杂程度类似与实际场景的Sample应用──Soundstagram(音频分享版的Instagram, ¯\_(ツ)_/¯),就是为了让大家能最快速地上手Reveal,尝试它的各种强大功能. 在 Help 菜单项中,点击 Inspect

qt 国际化(翻译时会触发changeEvent)

1. 修改工程文件 .pro ,加入翻译源文件 hello_world.ts: TRANSLATIONS += \        Resource/translations/hello_world.ts 写代码时需要注意下面两点:  2. 源码用 utf-8 字符集3. 源码中需要翻译的字符串必须用英文(不能有中文或其它语言),则需要用 tr()  函数.  例如: QMessageBox::information(this,tr("Information"),tr("Hel