Forum Moderators: open
OK, first of all, I'm assuming this is all going to be built in DHTML? You'll have to build from scratch. And it's a tricky one - there are many many ways to approach this problem...
Without delving into example code, I can describe some of the ingredients:
First I'd create the 5 <div>, each styled with the paint color, and with an onclick event which assigns that color to a global JS variable.
Listen to the onmousedown event, and start a setInterval() which adds a new 1x1 element at the current mouse X and Y position, and styled with your current brush color. Then onmouseup, clearInterval(). A simple, ultraprimitive stylus.