Today at work I needed a Color Chooser dialog that supported Alpha. The standard Windows Color Picker from Common Controls can’t do that I don’t think. Hence I decided to have a look at the code in Paint.Net’s color dialog which does.
Outwardly Paint.Net looks well engineered, therefore I went looking at the source. Crikey what a mess. Now I know how hard it is to write and manage a moderately sized code-base with a small team, but I at least try and organize my code well. I also constantly refactor to improve the design & code readability.
After spending the day trying to adapt Paint.Net’s color picker I ran into some serious performance issues (amongst other things). It seems their gradient widget renderer is very slow for anything other than the tiny little gradients that get rendered in their color picker form. I think someone needs to introduce them to
InterpolationColors property and
I think the coders on Paint.Net probably already know some of their code is pretty dire, considering this comment in
// TODO: rewrite this … the code is out of control here as it has grown organically,
// and it’s impossible to maintain. post-3.0
Now I’m not trying to pick on the coders responsible for Paint.Net. I’d actually like to thank them, as I use the application regularly and appreciate that the code is MIT licensed. This is what enables me to go rifling through their code in the first place.
But unfortunately for me the Color Picker code is not good enough and is too Paint.Net specific. I’m going to have to write my own damn fancy color picker.