Sunday, July 22, 2007

Color picker working!!!

After some heartache, I finally got the colorpicker working. Now the user can change the colors for each of the haplotypes on the preview pane. I used Knallgrau's color picker as a base for this.

I ran into many problems trying to get an event handler to fire correctly. I tried at first to have the pie colors update simultaneously with the color picker's. I wanted to associate an event handler with changes to the input field's value (string of HTML color type), but for some reason the value is hidden from the event handler. Eventually, I tied an event handler to clicking the 'ok' button of the color picker. There is only one color picker display for all of the haplotypes though, so I had to loop through them all to find the one that had changed. Then we loop through the corresponding pie slice and reset their fill color. Remarkably, this is super fast.

No comments: