Updated RGB to CIE color conversion code

Used logic from Q42's Q42.HueApi C# project to implement CIE
range-clamping (avoiding attempting to set lamps to unreproducible
colors).