Tidying up color selection code