constantized magic numbers, removed enumerated type, uses new methods to calculate RGB with better error handling