SBRL Archives: Colour Picker
Since I've been rather ill suffering the after effects of this year's flu vaccination and I haven't finished the next post I was writing for this week, I'm posting this instead :-)
The project in question (as you might have guessed by the title) is a simple colour picker. You can find it here:
I've been careful to make only minimal changes to the code before uploading it here (updating comments, switching
onload out for
window.addEventListener() etc.) - it's interesting to compare my programming style then to the way that I do things now, especially since I was entirely self-taught at that point in time.
Looking back now, there are several things I'd change. For one I'd remove the dependency on
functions.js - an early attempt of mine to create a utility library, and rather put each method in a gist and copy the ones I need. For another I'd certainly separate the code that writes to the DOM (and update it to use a document fragment & the DOM api rather than
innerHTML) from the code that performs the core logic.
Hopefully this post has been an interesting read - I should have the next regular post ready for later this week :-)