O'Reilly logo

Flickr Hacks by Jim Bumgardner, Paul Bausch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #45. Make a Color Picker

This colorful interface is fun to use and functional.

The Flickr Colr Pickr (http://www.krazydad.com/colrpickr/) was one of the first Flickr-powered applications I built, and it has been the inspiration for a lot of my other Flickr-related work. The basic idea was to combine an HSV color picker, a common feature in many paint and illustration programs, with a photo browser. When you click on a color on the color wheel, a group of thumbnail images that match the color pops up nearly instantaneously.

Most users quickly grasp the basic concept of "point at a color, see pretty pictures" and have a lot of fun playing with it. Many artists and designers have told me they find this a useful interface for searching for photos that match a particular palette.

People often assume that this interface makes use of a color-search capability built into Flickr, but alas, Flickr offers no such service (yet). To make a color picker, you must first precompute the average colors of the photos you wish to search. This is done using the Perl script developed in [Hack #44] . Here, we'll use a new Perl script to convert that information to an ActionScript text file, which we can then include in a Flash movie. The HSV color picker interface is created using Flash ActionScript.

What You Need

This hack uses the modular Perl scripts developed in [Hack #33], [Hack #34], and [Hack #44] . The Flash template used in this hack requires Macromedia Flash MX or a later version.

To view ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required