Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default gradient colors #24

Closed
JakeLin opened this issue Jan 1, 2016 · 14 comments
Closed

Default gradient colors #24

JakeLin opened this issue Jan 1, 2016 · 14 comments

Comments

@JakeLin
Copy link
Member

JakeLin commented Jan 1, 2016

Predefined gradient colors from http://uigradients.com/

@tbaranes
Copy link
Member

tbaranes commented Feb 6, 2016

I like this idea, but I'm asking myself how that will render when used. I suppose it will be a big enum with each gradient, then DesignableGradient will have a designable defaultGradient, but in order to use it, we will have to enter a string in the defaultGradient field? Some of them are understandable, but not all... don't you think?

@JakeLin
Copy link
Member Author

JakeLin commented Feb 7, 2016

@tbaranes Sorry for the late reply, yesterday, I brought my son to see the lion dancing.

I have thought through that before I created this card. It will automatically generate a enum GradientType from https://github.com/Ghosh/uiGradients/blob/master/gradients.json vis JavaScript or Swift script. Similar to what I did for
https://github.com/JakeLin/SwiftWeather/blob/master/SwiftWeather/WeatherIcon.swift . Then we can easily update it when the json has been updated.

Do you think presetGradient or predefinedGradient is a better name than defaultGradient? Because of IB's limitation, we have to enter a string like SunnyDays, GreenBeach refer to gradients.json. To let the user understands the more, we need to put a link in our API document to http://uigradients.com/ then they can preview all of them and copy the gradient name (string for enum rawValue).

Please let me know if you have any questions. Thanks.

@tbaranes
Copy link
Member

tbaranes commented Feb 8, 2016

Got it. Interesting implementation.

I like predefinedGradient, but all of them seems good names for this feature.

@lexrus
Copy link
Member

lexrus commented Feb 8, 2016

We can use Ruby:

require 'open-uri'
require 'JSON'

JSON_URL = 'https://raw.githubusercontent.com/Ghosh/uiGradients/master/gradients.json'

def hexToRgb(hex)
  if m = /#(..)(..)(..)/.match(hex)
    return "red: #{m[1].hex} green: #{m[2].hex} blue: #{m[3].hex}"
  end
end

gradients = JSON.load(open(JSON_URL))

puts "private let predefinedGradients: [String: [String]] = ["

gradients.each do |g|
  name = g['name']
  from, to = g['colors']
  puts "  \"#{name}\": [\"#{from}\", \"#{to}\"],"
end

puts "]"

It outputs:

private let predefinedGradients: [String: [String]] = [
  "Sunny Days": ["#EDE574", "#E1F5C4"],
  "Green Beach": ["#02AAB0", "#00CDAC"],
  "Intuitive Purple": ["#DA22FF", "#9733EE"],
  "Emerald Water": ["#348F50", "#56B4D3"],
  "Lemon Twist": ["#3CA55C", "#B5AC49"],
  "Horizon": ["#003973", "#E5E5BE"],
  "Rose Water": ["#E55D87", "#5FC3E4"],
  "Frozen": ["#403B4A", "#E7E9BB"],
  "Mango Pulp": ["#F09819", "#EDDE5D"],
  "Bloody Mary": ["#FF512F", "#DD2476"],
  "Aubergine": ["#AA076B", "#61045F"],
  "Aqua Marine": ["#1A2980", "#26D0CE"],
  "Sunrise": ["#FF512F", "#F09819"],
  "Purple Paradise": ["#1D2B64", "#F8CDDA"],
  "Sea Weed": ["#4CB8C4", "#3CD3AD"],
  "Pinky": ["#DD5E89", "#F7BB97"],
  "Cherry": ["#EB3349", "#F45C43"],
  "Mojito": ["#1D976C", "#93F9B9"],
  "Juicy Orange": ["#FF8008", "#FFC837"],
  "Mirage": ["#16222A", "#3A6073"],
  "Steel Gray": ["#1F1C2C", "#928DAB"],
  "Kashmir": ["#614385", "#516395"],
  "Electric Violet": ["#4776E6", "#8E54E9"],
  "Venice Blue": ["#085078", "#85D8CE"],
  "Bora Bora": ["#2BC0E4", "#EAECC6"],
  "Moss": ["#134E5E", "#71B280"],
  "Shroom Haze": ["#5C258D", "#4389A2"],
  "Mystic": ["#757F9A", "#D7DDE8"],
  "Midnight City": ["#232526", "#414345"],
  "Sea Blizz": ["#1CD8D2", "#93EDC7"],
  "Opa": ["#3D7EAA", "#FFE47A"],
  "Titanium": ["#283048", "#859398"],
  "Mantle": ["#24C6DC", "#514A9D"],
  "Dracula": ["#DC2424", "#4A569D"],
  "Peach": ["#ED4264", "#FFEDBC"],
  "Moonrise": ["#DAE2F8", "#D6A4A4"],
  "Clouds": ["#ECE9E6", "#FFFFFF"],
  "Stellar": ["#7474BF", "#348AC7"],
  "Bourbon": ["#EC6F66", "#F3A183"],
  "Calm Darya": ["#5f2c82", "#49a09d"],
  "Influenza": ["#C04848", "#480048"],
  "Shrimpy": ["#e43a15", "#e65245"],
  "Army": ["#414d0b", "#727a17"],
  "Miaka": ["#FC354C", "#0ABFBC"],
  "Pinot Noir": ["#4b6cb7", "#182848"],
  "Day Tripper": ["#f857a6", "#ff5858"],
  "Namn": ["#a73737", "#7a2828"],
  "Blurry Beach": ["#d53369", "#cbad6d"],
  "Vasily": ["#e9d362", "#333333"],
  "A Lost Memory": ["#DE6262", "#FFB88C"],
  "Petrichor": ["#666600", "#999966"],
  "Jonquil": ["#FFEEEE", "#DDEFBB"],
  "Sirius Tamed": ["#EFEFBB", "#D4D3DD"],
  "Kyoto": ["#c21500", "#ffc500"],
  "Misty Meadow": ["#215f00", "#e4e4d9"],
  "Aqualicious": ["#50C9C3", "#96DEDA"],
  "Moor": ["#616161", "#9bc5c3"],
  "Almost": ["#ddd6f3", "#faaca8"],
  "Forever Lost": ["#5D4157", "#A8CABA"],
  "Winter": ["#E6DADA", "#274046"],
  "Autumn": ["#DAD299", "#B0DAB9"],
  "Candy": ["#D3959B", "#BFE6BA"],
  "Reef": ["#00d2ff", "#3a7bd5"],
  "The Strain": ["#870000", "#190A05"],
  "Dirty Fog": ["#B993D6", "#8CA6DB"],
  "Earthly": ["#649173", "#DBD5A4"],
  "Virgin": ["#C9FFBF", "#FFAFBD"],
  "Ash": ["#606c88", "#3f4c6b"],
  "Shadow Night": ["#000000", "#53346D"],
  "Cherryblossoms": ["#FBD3E9", "#BB377D"],
  "Parklife": ["#ADD100", "#7B920A"],
  "Dance To Forget": ["#FF4E50", "#F9D423"],
  "Starfall": ["#F0C27B", "#4B1248"],
  "Red Mist": ["#000000", "#e74c3c"],
  "Teal Love": ["#AAFFA9", "#11FFBD"],
  "Neon Life": ["#B3FFAB", "#12FFF7"],
  "Man of Steel": ["#780206", "#061161"],
  "Amethyst": ["#9D50BB", "#6E48AA"],
  "Cheer Up Emo Kid": ["#556270", "#FF6B6B"],
  "Shore": ["#70e1f5", "#ffd194"],
  "Facebook Messenger": ["#00c6ff", "#0072ff"],
  "SoundCloud": ["#fe8c00", "#f83600"],
  "Behongo": ["#52c234", "#061700"],
  "ServQuick": ["#485563", "#29323c"],
  "Friday": ["#83a4d4", "#b6fbff"],
  "Martini": ["#FDFC47", "#24FE41"],
  "Metallic Toad": ["#abbaab", "#ffffff"],
  "Between The Clouds": ["#73C8A9", "#373B44"],
  "Crazy Orange I": ["#D38312", "#A83279"],
  "Hersheys": ["#1e130c", "#9a8478"],
  "Talking To Mice Elf": ["#948E99", "#2E1437"],
  "Purple Bliss": ["#360033", "#0b8793"],
  "Predawn": ["#FFA17F", "#00223E"],
  "Endless River": ["#43cea2", "#185a9d"],
  "Pastel Orange at the Sun": ["#ffb347", "#ffcc33"],
  "Twitch": ["#6441A5", "#2a0845"],
  "Instagram": ["#517fa4", "#243949"],
  "Flickr": ["#ff0084", "#33001b"],
  "Vine": ["#00bf8f", "#001510"],
  "Turquoise flow": ["#136a8a", "#267871"],
  "Portrait": ["#8e9eab", "#eef2f3"],
  "Virgin America": ["#7b4397", "#dc2430"],
  "Koko Caramel": ["#D1913C", "#FFD194"],
  "Fresh Turboscent": ["#F1F2B5", "#135058"],
  "Green to dark": ["#6A9113", "#141517"],
  "Ukraine": ["#004FF9", "#FFF94C"],
  "Curiosity blue": ["#525252", "#3d72b4"],
  "Dark Knight": ["#BA8B02", "#181818"],
  "Piglet": ["#ee9ca7", "#ffdde1"],
  "Lizard": ["#304352", "#d7d2cc"],
  "Sage Persuasion": ["#CCCCB2", "#757519"],
  "Between Night and Day": ["#2c3e50", "#3498db"],
  "Timber": ["#fc00ff", "#00dbde"],
  "Passion": ["#e53935", "#e35d5b"],
  "Clear Sky": ["#005C97", "#363795"],
  "Master Card": ["#f46b45", "#eea849"],
  "Back To Earth": ["#00C9FF", "#92FE9D"],
  "Deep Purple": ["#673AB7", "#512DA8"],
  "Little Leaf": ["#76b852", "#8DC26F"],
  "Netflix": ["#8E0E00", "#1F1C18"],
  "Light Orange": ["#FFB75E", "#ED8F03"],
  "Green and Blue": ["#c2e59c", "#64b3f4"],
  "Poncho": ["#403A3E", "#BE5869"],
  "Back to the Future": ["#C02425", "#F0CB35"],
  "Blush": ["#B24592", "#F15F79"],
  "Inbox": ["#457fca", "#5691c8"],
  "Purplin": ["#6a3093", "#a044ff"],
  "Pale Wood": ["#eacda3", "#d6ae7b"],
  "Haikus": ["#fd746c", "#ff9068"],
  "Pizelex": ["#114357", "#F29492"],
  "Joomla": ["#1e3c72", "#2a5298"],
  "Christmas": ["#2F7336", "#AA3A38"],
  "Minnesota Vikings": ["#5614B0", "#DBD65C"],
  "Miami Dolphins": ["#4DA0B0", "#D39D38"],
  "Forest": ["#5A3F37", "#2C7744"],
  "Nighthawk": ["#2980b9", "#2c3e50"],
  "Superman": ["#0099F7", "#F11712"],
  "Suzy": ["#834d9b", "#d04ed6"],
  "Dark Skies": ["#4B79A1", "#283E51"],
]

@JakeLin
Copy link
Member Author

JakeLin commented Feb 8, 2016

@lexrus do you think we can also create an enum like .SunnyDays, .Suzy and .DarkSkies for code and map it to ["#4B79A1", "#283E51"] in configurePredefinedGradient(gradientType: GradientType). I think most of code can be generated by a script like yours.

@JakeLin
Copy link
Member Author

JakeLin commented Feb 8, 2016

@tbaranes I got some ideas to support random data for prototyping, will create a issue to document that. For example, random color, random name or random address.

InVision just released a Sketch plugin today. http://labs.invisionapp.com/craft . I did some Sketch plugin for internal use before. I work for a property website, and made some plugins for populating property images, address and price from live backend services. Designers love to use them to save time.

Back to IBAnimatable, If possible to support plugin like what jQuery does, data generator or live data populator will be useful for prototyping. Gradient colors or Flat colors would be the good start. Because we can bring them in production. But the other fake data should not use for prototyping.

@lexrus
Copy link
Member

lexrus commented Feb 8, 2016

enum can have primitive type only, how can I 'map' it?

@lexrus
Copy link
Member

lexrus commented Feb 8, 2016

Got an idea, but it's tricky...

private enum predefinedGradients: Int {
    case WhiteToBlack = 0xFFFFFF000000
}

@JakeLin
Copy link
Member Author

JakeLin commented Feb 9, 2016

@lexrus Swift enum can inherit from String like

public enum GradientType: String {
  case SunnyDays
  case Suzy
  case DarkSkies
}

then we can map it like

switch predefinedGradient {
    case .SunnyDays:
      startColor = UIColor("EDE574")
      endColor = UIColor("E1F5C4")
    case .Suzy:
}

All the code can be generated by a script. we develop the script. How do you think of this approach?

@tbaranes
Copy link
Member

tbaranes commented Feb 9, 2016

Personally, I agree that the enum string is the best solution. Combined with the script, it would be really easier to create and maintain for the long term process.

For the programming language, couldn't make it directly in swift? Anyway, it's not really important. I don't think that will be a lot of work to do whichever is the final language.

@JakeLin
Copy link
Member Author

JakeLin commented Feb 9, 2016

Swift +1

@tbaranes
Copy link
Member

tbaranes commented Feb 9, 2016

I made a try with a swift script. I think it's a nice way to handle the issue.

Just one thing I'm not sure yet: do we prefer that the script create directly (overwrite) the files where will be the enum / switch, or should we just print the output and copy/paste the result where it's necessary?

Here the output:

public enum GradientType: String {
    case SunnyDays
    case GreenBeach
    case IntuitivePurple
    case EmeraldWater
    case LemonTwist
    case Horizon
    case RoseWater
    case Frozen
    case MangoPulp
    case BloodyMary
    case Aubergine
    case AquaMarine
    case Sunrise
    case PurpleParadise
    case SeaWeed
    case Pinky
    case Cherry
    case Mojito
    case JuicyOrange
    case Mirage
    case SteelGray
    case Kashmir
    case ElectricViolet
    case VeniceBlue
    case BoraBora
    case Moss
    case ShroomHaze
    case Mystic
    case MidnightCity
    case SeaBlizz
    case Opa
    case Titanium
    case Mantle
    case Dracula
    case Peach
    case Moonrise
    case Clouds
    case Stellar
    case Bourbon
    case CalmDarya
    case Influenza
    case Shrimpy
    case Army
    case Miaka
    case PinotNoir
    case DayTripper
    case Namn
    case BlurryBeach
    case Vasily
    case ALostMemory
    case Petrichor
    case Jonquil
    case SiriusTamed
    case Kyoto
    case MistyMeadow
    case Aqualicious
    case Moor
    case Almost
    case ForeverLost
    case Winter
    case Autumn
    case Candy
    case Reef
    case TheStrain
    case DirtyFog
    case Earthly
    case Virgin
    case Ash
    case ShadowNight
    case Cherryblossoms
    case Parklife
    case DanceToForget
    case Starfall
    case RedMist
    case TealLove
    case NeonLife
    case ManofSteel
    case Amethyst
    case CheerUpEmoKid
    case Shore
    case FacebookMessenger
    case SoundCloud
    case Behongo
    case ServQuick
    case Friday
    case Martini
    case MetallicToad
    case BetweenTheClouds
    case CrazyOrangeI
    case Hersheys
    case TalkingToMiceElf
    case PurpleBliss
    case Predawn
    case EndlessRiver
    case PastelOrangeattheSun
    case Twitch
    case Instagram
    case Flickr
    case Vine
    case Turquoiseflow
    case Portrait
    case VirginAmerica
    case KokoCaramel
    case FreshTurboscent
    case Greentodark
    case Ukraine
    case Curiosityblue
    case DarkKnight
    case Piglet
    case Lizard
    case SagePersuasion
    case BetweenNightandDay
    case Timber
    case Passion
    case ClearSky
    case MasterCard
    case BackToEarth
    case DeepPurple
    case LittleLeaf
    case Netflix
    case LightOrange
    case GreenandBlue
    case Poncho
    case BacktotheFuture
    case Blush
    case Inbox
    case Purplin
    case PaleWood
    case Haikus
    case Pizelex
    case Joomla
    case Christmas
    case MinnesotaVikings
    case MiamiDolphins
    case Forest
    case Nighthawk
    case Superman
    case Suzy
    case DarkSkies
}
switch predefinedGradient {
case .SunnyDays:
    startColor = UIColor("#EDE574")
    endColor = UIColor("#E1F5C4")
case .GreenBeach:
    startColor = UIColor("#02AAB0")
    endColor = UIColor("#00CDAC")
case .IntuitivePurple:
    startColor = UIColor("#DA22FF")
    endColor = UIColor("#9733EE")
case .EmeraldWater:
    startColor = UIColor("#348F50")
    endColor = UIColor("#56B4D3")
case .LemonTwist:
    startColor = UIColor("#3CA55C")
    endColor = UIColor("#B5AC49")
case .Horizon:
    startColor = UIColor("#003973")
    endColor = UIColor("#E5E5BE")
case .RoseWater:
    startColor = UIColor("#E55D87")
    endColor = UIColor("#5FC3E4")
case .Frozen:
    startColor = UIColor("#403B4A")
    endColor = UIColor("#E7E9BB")
case .MangoPulp:
    startColor = UIColor("#F09819")
    endColor = UIColor("#EDDE5D")
case .BloodyMary:
    startColor = UIColor("#FF512F")
    endColor = UIColor("#DD2476")
case .Aubergine:
    startColor = UIColor("#AA076B")
    endColor = UIColor("#61045F")
case .AquaMarine:
    startColor = UIColor("#1A2980")
    endColor = UIColor("#26D0CE")
case .Sunrise:
    startColor = UIColor("#FF512F")
    endColor = UIColor("#F09819")
case .PurpleParadise:
    startColor = UIColor("#1D2B64")
    endColor = UIColor("#F8CDDA")
case .SeaWeed:
    startColor = UIColor("#4CB8C4")
    endColor = UIColor("#3CD3AD")
case .Pinky:
    startColor = UIColor("#DD5E89")
    endColor = UIColor("#F7BB97")
case .Cherry:
    startColor = UIColor("#EB3349")
    endColor = UIColor("#F45C43")
case .Mojito:
    startColor = UIColor("#1D976C")
    endColor = UIColor("#93F9B9")
case .JuicyOrange:
    startColor = UIColor("#FF8008")
    endColor = UIColor("#FFC837")
case .Mirage:
    startColor = UIColor("#16222A")
    endColor = UIColor("#3A6073")
case .SteelGray:
    startColor = UIColor("#1F1C2C")
    endColor = UIColor("#928DAB")
case .Kashmir:
    startColor = UIColor("#614385")
    endColor = UIColor("#516395")
case .ElectricViolet:
    startColor = UIColor("#4776E6")
    endColor = UIColor("#8E54E9")
case .VeniceBlue:
    startColor = UIColor("#085078")
    endColor = UIColor("#85D8CE")
case .BoraBora:
    startColor = UIColor("#2BC0E4")
    endColor = UIColor("#EAECC6")
case .Moss:
    startColor = UIColor("#134E5E")
    endColor = UIColor("#71B280")
case .ShroomHaze:
    startColor = UIColor("#5C258D")
    endColor = UIColor("#4389A2")
case .Mystic:
    startColor = UIColor("#757F9A")
    endColor = UIColor("#D7DDE8")
case .MidnightCity:
    startColor = UIColor("#232526")
    endColor = UIColor("#414345")
case .SeaBlizz:
    startColor = UIColor("#1CD8D2")
    endColor = UIColor("#93EDC7")
case .Opa:
    startColor = UIColor("#3D7EAA")
    endColor = UIColor("#FFE47A")
case .Titanium:
    startColor = UIColor("#283048")
    endColor = UIColor("#859398")
case .Mantle:
    startColor = UIColor("#24C6DC")
    endColor = UIColor("#514A9D")
case .Dracula:
    startColor = UIColor("#DC2424")
    endColor = UIColor("#4A569D")
case .Peach:
    startColor = UIColor("#ED4264")
    endColor = UIColor("#FFEDBC")
case .Moonrise:
    startColor = UIColor("#DAE2F8")
    endColor = UIColor("#D6A4A4")
case .Clouds:
    startColor = UIColor("#ECE9E6")
    endColor = UIColor("#FFFFFF")
case .Stellar:
    startColor = UIColor("#7474BF")
    endColor = UIColor("#348AC7")
case .Bourbon:
    startColor = UIColor("#EC6F66")
    endColor = UIColor("#F3A183")
case .CalmDarya:
    startColor = UIColor("#5f2c82")
    endColor = UIColor("#49a09d")
case .Influenza:
    startColor = UIColor("#C04848")
    endColor = UIColor("#480048")
case .Shrimpy:
    startColor = UIColor("#e43a15")
    endColor = UIColor("#e65245")
case .Army:
    startColor = UIColor("#414d0b")
    endColor = UIColor("#727a17")
case .Miaka:
    startColor = UIColor("#FC354C")
    endColor = UIColor("#0ABFBC")
case .PinotNoir:
    startColor = UIColor("#4b6cb7")
    endColor = UIColor("#182848")
case .DayTripper:
    startColor = UIColor("#f857a6")
    endColor = UIColor("#ff5858")
case .Namn:
    startColor = UIColor("#a73737")
    endColor = UIColor("#7a2828")
case .BlurryBeach:
    startColor = UIColor("#d53369")
    endColor = UIColor("#cbad6d")
case .Vasily:
    startColor = UIColor("#e9d362")
    endColor = UIColor("#333333")
case .ALostMemory:
    startColor = UIColor("#DE6262")
    endColor = UIColor("#FFB88C")
case .Petrichor:
    startColor = UIColor("#666600")
    endColor = UIColor("#999966")
case .Jonquil:
    startColor = UIColor("#FFEEEE")
    endColor = UIColor("#DDEFBB")
case .SiriusTamed:
    startColor = UIColor("#EFEFBB")
    endColor = UIColor("#D4D3DD")
case .Kyoto:
    startColor = UIColor("#c21500")
    endColor = UIColor("#ffc500")
case .MistyMeadow:
    startColor = UIColor("#215f00")
    endColor = UIColor("#e4e4d9")
case .Aqualicious:
    startColor = UIColor("#50C9C3")
    endColor = UIColor("#96DEDA")
case .Moor:
    startColor = UIColor("#616161")
    endColor = UIColor("#9bc5c3")
case .Almost:
    startColor = UIColor("#ddd6f3")
    endColor = UIColor("#faaca8")
case .ForeverLost:
    startColor = UIColor("#5D4157")
    endColor = UIColor("#A8CABA")
case .Winter:
    startColor = UIColor("#E6DADA")
    endColor = UIColor("#274046")
case .Autumn:
    startColor = UIColor("#DAD299")
    endColor = UIColor("#B0DAB9")
case .Candy:
    startColor = UIColor("#D3959B")
    endColor = UIColor("#BFE6BA")
case .Reef:
    startColor = UIColor("#00d2ff")
    endColor = UIColor("#3a7bd5")
case .TheStrain:
    startColor = UIColor("#870000")
    endColor = UIColor("#190A05")
case .DirtyFog:
    startColor = UIColor("#B993D6")
    endColor = UIColor("#8CA6DB")
case .Earthly:
    startColor = UIColor("#649173")
    endColor = UIColor("#DBD5A4")
case .Virgin:
    startColor = UIColor("#C9FFBF")
    endColor = UIColor("#FFAFBD")
case .Ash:
    startColor = UIColor("#606c88")
    endColor = UIColor("#3f4c6b")
case .ShadowNight:
    startColor = UIColor("#000000")
    endColor = UIColor("#53346D")
case .Cherryblossoms:
    startColor = UIColor("#FBD3E9")
    endColor = UIColor("#BB377D")
case .Parklife:
    startColor = UIColor("#ADD100")
    endColor = UIColor("#7B920A")
case .DanceToForget:
    startColor = UIColor("#FF4E50")
    endColor = UIColor("#F9D423")
case .Starfall:
    startColor = UIColor("#F0C27B")
    endColor = UIColor("#4B1248")
case .RedMist:
    startColor = UIColor("#000000")
    endColor = UIColor("#e74c3c")
case .TealLove:
    startColor = UIColor("#AAFFA9")
    endColor = UIColor("#11FFBD")
case .NeonLife:
    startColor = UIColor("#B3FFAB")
    endColor = UIColor("#12FFF7")
case .ManofSteel:
    startColor = UIColor("#780206")
    endColor = UIColor("#061161")
case .Amethyst:
    startColor = UIColor("#9D50BB")
    endColor = UIColor("#6E48AA")
case .CheerUpEmoKid:
    startColor = UIColor("#556270")
    endColor = UIColor("#FF6B6B")
case .Shore:
    startColor = UIColor("#70e1f5")
    endColor = UIColor("#ffd194")
case .FacebookMessenger:
    startColor = UIColor("#00c6ff")
    endColor = UIColor("#0072ff")
case .SoundCloud:
    startColor = UIColor("#fe8c00")
    endColor = UIColor("#f83600")
case .Behongo:
    startColor = UIColor("#52c234")
    endColor = UIColor("#061700")
case .ServQuick:
    startColor = UIColor("#485563")
    endColor = UIColor("#29323c")
case .Friday:
    startColor = UIColor("#83a4d4")
    endColor = UIColor("#b6fbff")
case .Martini:
    startColor = UIColor("#FDFC47")
    endColor = UIColor("#24FE41")
case .MetallicToad:
    startColor = UIColor("#abbaab")
    endColor = UIColor("#ffffff")
case .BetweenTheClouds:
    startColor = UIColor("#73C8A9")
    endColor = UIColor("#373B44")
case .CrazyOrangeI:
    startColor = UIColor("#D38312")
    endColor = UIColor("#A83279")
case .Hersheys:
    startColor = UIColor("#1e130c")
    endColor = UIColor("#9a8478")
case .TalkingToMiceElf:
    startColor = UIColor("#948E99")
    endColor = UIColor("#2E1437")
case .PurpleBliss:
    startColor = UIColor("#360033")
    endColor = UIColor("#0b8793")
case .Predawn:
    startColor = UIColor("#FFA17F")
    endColor = UIColor("#00223E")
case .EndlessRiver:
    startColor = UIColor("#43cea2")
    endColor = UIColor("#185a9d")
case .PastelOrangeattheSun:
    startColor = UIColor("#ffb347")
    endColor = UIColor("#ffcc33")
case .Twitch:
    startColor = UIColor("#6441A5")
    endColor = UIColor("#2a0845")
case .Instagram:
    startColor = UIColor("#517fa4")
    endColor = UIColor("#243949")
case .Flickr:
    startColor = UIColor("#ff0084")
    endColor = UIColor("#33001b")
case .Vine:
    startColor = UIColor("#00bf8f")
    endColor = UIColor("#001510")
case .Turquoiseflow:
    startColor = UIColor("#136a8a")
    endColor = UIColor("#267871")
case .Portrait:
    startColor = UIColor("#8e9eab")
    endColor = UIColor("#eef2f3")
case .VirginAmerica:
    startColor = UIColor("#7b4397")
    endColor = UIColor("#dc2430")
case .KokoCaramel:
    startColor = UIColor("#D1913C")
    endColor = UIColor("#FFD194")
case .FreshTurboscent:
    startColor = UIColor("#F1F2B5")
    endColor = UIColor("#135058")
case .Greentodark:
    startColor = UIColor("#6A9113")
    endColor = UIColor("#141517")
case .Ukraine:
    startColor = UIColor("#004FF9")
    endColor = UIColor("#FFF94C")
case .Curiosityblue:
    startColor = UIColor("#525252")
    endColor = UIColor("#3d72b4")
case .DarkKnight:
    startColor = UIColor("#BA8B02")
    endColor = UIColor("#181818")
case .Piglet:
    startColor = UIColor("#ee9ca7")
    endColor = UIColor("#ffdde1")
case .Lizard:
    startColor = UIColor("#304352")
    endColor = UIColor("#d7d2cc")
case .SagePersuasion:
    startColor = UIColor("#CCCCB2")
    endColor = UIColor("#757519")
case .BetweenNightandDay:
    startColor = UIColor("#2c3e50")
    endColor = UIColor("#3498db")
case .Timber:
    startColor = UIColor("#fc00ff")
    endColor = UIColor("#00dbde")
case .Passion:
    startColor = UIColor("#e53935")
    endColor = UIColor("#e35d5b")
case .ClearSky:
    startColor = UIColor("#005C97")
    endColor = UIColor("#363795")
case .MasterCard:
    startColor = UIColor("#f46b45")
    endColor = UIColor("#eea849")
case .BackToEarth:
    startColor = UIColor("#00C9FF")
    endColor = UIColor("#92FE9D")
case .DeepPurple:
    startColor = UIColor("#673AB7")
    endColor = UIColor("#512DA8")
case .LittleLeaf:
    startColor = UIColor("#76b852")
    endColor = UIColor("#8DC26F")
case .Netflix:
    startColor = UIColor("#8E0E00")
    endColor = UIColor("#1F1C18")
case .LightOrange:
    startColor = UIColor("#FFB75E")
    endColor = UIColor("#ED8F03")
case .GreenandBlue:
    startColor = UIColor("#c2e59c")
    endColor = UIColor("#64b3f4")
case .Poncho:
    startColor = UIColor("#403A3E")
    endColor = UIColor("#BE5869")
case .BacktotheFuture:
    startColor = UIColor("#C02425")
    endColor = UIColor("#F0CB35")
case .Blush:
    startColor = UIColor("#B24592")
    endColor = UIColor("#F15F79")
case .Inbox:
    startColor = UIColor("#457fca")
    endColor = UIColor("#5691c8")
case .Purplin:
    startColor = UIColor("#6a3093")
    endColor = UIColor("#a044ff")
case .PaleWood:
    startColor = UIColor("#eacda3")
    endColor = UIColor("#d6ae7b")
case .Haikus:
    startColor = UIColor("#fd746c")
    endColor = UIColor("#ff9068")
case .Pizelex:
    startColor = UIColor("#114357")
    endColor = UIColor("#F29492")
case .Joomla:
    startColor = UIColor("#1e3c72")
    endColor = UIColor("#2a5298")
case .Christmas:
    startColor = UIColor("#2F7336")
    endColor = UIColor("#AA3A38")
case .MinnesotaVikings:
    startColor = UIColor("#5614B0")
    endColor = UIColor("#DBD65C")
case .MiamiDolphins:
    startColor = UIColor("#4DA0B0")
    endColor = UIColor("#D39D38")
case .Forest:
    startColor = UIColor("#5A3F37")
    endColor = UIColor("#2C7744")
case .Nighthawk:
    startColor = UIColor("#2980b9")
    endColor = UIColor("#2c3e50")
case .Superman:
    startColor = UIColor("#0099F7")
    endColor = UIColor("#F11712")
case .Suzy:
    startColor = UIColor("#834d9b")
    endColor = UIColor("#d04ed6")
case .DarkSkies:
    startColor = UIColor("#4B79A1")
    endColor = UIColor("#283E51")
}

@JakeLin
Copy link
Member Author

JakeLin commented Feb 10, 2016

As someone may read this thread. The generated code looks like this

case .DarkSkies:
      return (UIColor(hexString: "#4B79A1"), UIColor(hexString: "#283E51"))

because init with all string maybe too wide.

@lexrus
Copy link
Member

lexrus commented Feb 10, 2016

Nice work, Tom.

What's the frequency we update the enum with this script?
In case there're breaking changes in the original repo, we should promise the stability of IBAnimatable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants