Updated coloring routine to use attributes.