A start at managing colors. There are clearly bugs in the way that colors are assigned.