in reply to how to sort hash of array by value

Have a subkey containing the order you wish the colors sorted in (e.g. $colorhash{CCgrey}{rank} = 2;)

Then you could later loop through colorhash testing the {rank} value.