🌈 UIColor Category for over 100 Brand Colors
Objective-C Swift Ruby
Latest commit c6b015e Oct 29, 2015 @dkhamsing Merge pull request #11 from frankenbot/master
Update redirects
Permalink
Failed to load latest commit information.
Assets Delete brandcolors.css Jul 9, 2014
BrandColors Add documentation Jan 9, 2015
Demo-ObjC
Demo-Swift
.gitignore Create project May 3, 2014
.travis.yml
BrandColors.podspec
LICENSE Initial commit May 2, 2014
README.md Update redirects Oct 29, 2015

README.md

BrandColors

UIColor Category for over 100 Brand Colors

Build Status Version License Platform

Installation

Manual

  • Add the files in the BrandColors folder to your project.
  • #import "UIColor+BrandColors.h"

CocoaPods

platform :ios, '7.0'
pod 'BrandColors'

Usage

Objective-C

UIButton *facebookButton = [[UIButton alloc] init];
facebookButton.backgroundColor = [UIColor bc_colorForBrand:@"Facebook"]; 

NSLog(@"BrandColors contains %@ brands:%@", @([UIColor bc_brands].count),[UIColor bc_brands]);

if ([[UIColor bc_brandsWithLightColor] containsObject:brand]) {
    cell.textLabel.textColor = [UIColor blackColor];    
}
else {
    cell.textLabel.textColor = [UIColor whiteColor];
}

If a brand is not in Brand Colors, the default color returned is [UIColor clearColor]

#define BC_DEFAULT_COLOR [UIColor clearColor]

bc_colorForBrand: attemps to match brands

UIColor *facebookColor;
// facebook or Facebook will work
facebookColor = [UIColor bc_colorForBrand:@"Facebook"]; 
facebookColor = [UIColor bc_colorForBrand:@"facebook"]; 

UIColor *yahooColor;
yahooColor = [UIColor bc_colorForBrand:@"yahoo"]; 
yahooColor = [UIColor bc_colorForBrand:@"Yahoo"]; 
yahooColor = [UIColor bc_colorForBrand:@"Yahoo!"];

Swift

var facebookButton = UIButton()
facebookButton.backgroundColor = UIColor.bc_colorForBrand("Facebook")

println("BrandColors contains \(UIColor.bc_brands().count) brands: \(UIColor.bc_brands())")

let lightColorBrands:[String] = UIColor.bc_brandsWithLightColor() as [String]
if ( contains(lightColorBrands,brand) ) {
  cell.textLabel?.textColor = UIColor.blackColor()
}  
else {
  cell.textLabel?.textColor = UIColor.whiteColor()
}

Demo

BrandColors includes two sample projects, one written in Objective-C and one written in Swift.

List of Brands

2015-01-09 08:47:24.306 Demo[60174:5216572] BrandColors contains 143 brands:(
    500px,
    "about.me",
    Acer,
    Adobe,
    Airbnb,
    Alibaba,
    Amazon,
    Android,
    AOL,
    Apple,
    ARM,
    Asana,
    "AT&T",
    Atlassian,
    "Barnes & Noble",
    BBC,
    Beats,
    Behance,
    Bing,
    bitly,
    Blizzard,
    Blogger,
    Box,
    Broadcom,
    BT,
    BuzzFeed,
    "China Mobile",
    Cisco,
    Corning,
    Dell,
    "Designer News",
    DirecTV,
    "Dish Network",
    Dribbble,
    Dropbox,
    Dyson,
    eBay,
    Ember,
    Engadget,
    Ericsson,
    Etsy,
    Evernote,
    Expedia,
    Facebook,
    FedEx,
    Firefox,
    Fitbit,
    Flickr,
    Flipboard,
    Flipkart,
    Foursquare,
    Foxconn,
    "General Electric",
    GitHub,
    Google,
    GoPro,
    "Hacker News",
    "Home Depot",
    HP,
    HTC,
    Huawei,
    Hulu,
    IBM,
    iHeartRadio,
    IKEA,
    IMDb,
    Instagram,
    Intel,
    Intuit,
    Jawbone,
    Kickstarter,
    LG,
    LINE,
    LinkedIn,
    Lyft,
    Microsoft,
    Mixpanel,
    Motorola,
    Mozilla,
    Nest,
    Netflix,
    Nintendo,
    Nokia,
    "NTT DoCoMo",
    NVIDIA,
    Opera,
    Panasonic,
    PayPal,
    Philips,
    Pinterest,
    Priceline,
    "Product Hunt",
    Qualcomm,
    Rdio,
    Reddit,
    Redfin,
    Roku,
    Rovio,
    Salesforce,
    Samsung,
    Shazam,
    Skype,
    Snapchat,
    SoftBank,
    SoundCloud,
    Spotify,
    Sprint,
    "Stack Overflow",
    StackOverflow,
    Staples,
    Starbucks,
    Stripe,
    "T-Mobile",
    Tesla,
    TMobile,
    Treehouse,
    Trello,
    Trulia,
    Tumblr,
    Twitch,
    Twitter,
    Uber,
    Ubuntu,
    Verizon,
    Vimeo,
    Vine,
    Visa,
    Vodafone,
    VSCO,
    Walmart,
    WeChat,
    WhatsApp,
    WordPress,
    XBOX,
    Xiaomi,
    Yahoo,
    Yandex,
    Yelp,
    Yo,
    YouTube,
    Zendesk,
    Zillow,
    ZTE
)

Credits

Thanks to Galen Gidman's http://brandcolors.net

Contact

License

BrandColors is available under the MIT license. See the LICENSE file for more info.