thermogl / TITokenField

An iOS version of the NSTokenField (See To: field in Mail and Messages).
http://thermoglobalnuclearwar.com/opensource/
599 stars 172 forks source link

Flat Token Design Support & Podspec file #90

Open callbacknull opened 10 years ago

callbacknull commented 10 years ago

In this PR I've added support for flat color tokens (i.e no gradients). When the token is selected/highlighted the color is adjusted to be either slightly lighter or darker dependent on a weighted brightness of the token's tintcolor. See the image below for an example.

For those who don't know, you can adjust your token's tintColor in the following delegate:

I also added the podspec file as this is fairly standard across pods to have it in the repo. (I would say at least 90% of the pods I've used / looked at have it this way)

flat_tokens

callbacknull commented 10 years ago

In TIToken's drawRect: method I'm pretty sure I segregated all the gradient color setting correctly. Well, The results sure look right. But let me know if I may have messed that up and I can fix it.