iOS Library For Automatically Generating A Color Scheme From An Image Like iTunes 11

One of the interesting features in iTunes 11 is how the color scheme changes when looking at the details for an album based on that album cover.

There’s been a lot of talk about how exactly to do this, and here’s a library you can use in your iOS apps to easily gather a color scheme based on an image. Luis Espinoza has put together a library based on these discussions called LEColorPicker automatically generates a color scheme containing 3 colors.

Here’s an image from the readme showing the library at work on a couple of images:

LEColorPicker

 

After processing an image you can easily access the background, primary and secondary colors:

#import "LEColorPicker.h"

[LEColorPicker pickColorFromImage:image onComplete:^(NSDictionary *colorsPickedDictionary) {
_outputView.backgroundColor = [colorsPickedDictionary objectForKey:@"BackgroundColor"];
_titleTextField.textColor = [colorsPickedDictionary objectForKey:@"PrimaryTextColor"];
_bodyTextField.textColor = [colorsPickedDictionary objectForKey:@"SecondaryTextColor"];
}];

You can find LEColorPicker on Github here.

You can find the original question/answer thread explaining the algorithm over at StackOverflow.

Not completely identical to iTunes 11 color picking, but still does a great job.

DeliciousTwitterFacebookRedditLinkedInEmail

Original article: iOS Library For Automatically Generating A Color Scheme From An Image Like iTunes 11

©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *