Ilac: Flex 3 Color Wheel  May 27th, 2009

So you need a way to choose colors in your Flex application. Simple, use mx.controls.ColorPicker, right?

Flex 3 Color Picker

Well... That's pretty weak unless you know every color that should be selectable. More often than not, you don't. So where is the color wheel? It's entirely missing! It seems that some are available online (such as this one), but there's no code for that except here, and it's 6 bucks (!?).

Pfft, I thought, we can do a lot better than that. After a lot of digging I found 2 ActionScript classes written by Ryan Taylor and Mario Klingemann which, heavily modified, allowed me to create 'Ilac.'

Ilac Screenshot

It's not perfect. A work in progress. It dispatches CHANGE events with the selected color (as a Number so you can do whatever you need to with it). It supports being used like any other component:

...and makes it easy to use it as a Popup by dispatching CLOSE on ROLL_OUT). You can remember the selected position and restore it with movement methods (initial stages) and you will soon be able to supply defaults to (or programmatically change) the brightness and saturation sliders values.

There's lots of work to be done, but with absolutely nothing better easily available... I felt like I should open source it early. Contributions are welcome (and easy, thanks to GitHub). Hopefully someone besides myself will find it useful. The code is (mostly) straight-forward and, after some polish, one might actually be able to use it in a real application!

So check out Ilac on GitHub, and give it a try. If you find problems you can use the issue tracker there or show up in #ilac on Freenode.

Some social stuff: