Chris Penny
Chris Penny

Reputation: 101

Are there any convenient ways for managing color schemes in an iOS app?

I was wondering if there are any standard or convenient ways for managing color schemes with storyboards in an iOS app, instead of having to manually change the colors of many different UI objects.

Thanks!

Upvotes: 1

Views: 639

Answers (2)

NRitH
NRitH

Reputation: 13893

This is a fine question. We once had to do a complete color palette adjustment in a very large (> 100 view controller) app, and it was a suboptimal experience. For colors that are defined in code, the changes were easy enough. For colors specified in xibs or storyboards, though, it sucked. Because IB stores colors as raw double RGB values, there's no easy way to grep through the xib and storyboard xml files to do a simple search and replace. I wound up having to write a Ruby script that would find RGB values in the XML files, convert the doubles to integers in the (0..255) range, and then prompt the user to enter new values. The script cached the user's answers so that the user wasn't prompted multiple times for the same color values.

In hindsight, I still would prefer to specify colors in the storyboards & xibs so that it's as WYSIWYG as possible, and instead insist that the designers can make the changes themselves if they ever decide to modify the palette. :)

Upvotes: 1

Tiago Lira
Tiago Lira

Reputation: 2550

There is a tintColor that a few interface elements will pick up by default. You can configure the storyboard (right side menu) on the Global Tint setting.

If you want more costumization, there is a cool recent feature called UIAppearance. It lets you costumize interface elements by code, and that is applied in all such elements across the app.

Here is more info: http://nshipster.com/uiappearance/

Upvotes: 1

Related Questions