This document describes the conversion between RGB and xy. It is important to differentiate between the various light types, because they do not all support the same color gamut. For example, the hue bulbs are very good at showing nice whites, while the LivingColors are generally a bit better at colors, like green and cyan. For more info, check out the supported lights page.
The colors of Hue lights are controlled by xy values in the CIE color space. Since this is a well defined color space that is independent of the gamut of any specific light, we know for sure that the same xy value always result in the same color, regardless of the type of light used (as long as the color is within the gamut of the light).
Current Philips Hue lights have a color gamut defined by 3 points, making it a tri