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:
After processing an image you can easily access the background, primary and secondary colors:
…
[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.
- Helper Library That Makes It Easy To Work With The Google Maps App URL Scheme
- Mini Xcode Plugin For Working Without The Gigantic Xcode Toolbar
- Find iOS Custom URL Schemes From Thousands Of Apps And Add Yours
- Get Users Tweeting From Your Apps Without Entering Their Info
- Top iOS Development Resources For Week Ended December 23rd, 2012
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.