More straightforward color decoding. Got rid of horrible switch satement.