Fixed the editor always requesting focus

Also made the colour selection code more efficient.