Instead of copying attributes from the screen. And other minor changes, e.g. don't select a colour when the mouse is dragged over the palette, instead of clicking on it.
Forked from termo's demo-draw.c