Handle tool/color switching more cleanly.