Programming NXT color sensor with NXC?
Since you are trying to solve a Rubik's cube, check out the source code for the MindCuber. The solution there is that the values are not actually converted into colors. Rather the raw values are converted to HSV and then sorted by hue. The actual value does not matter, just how close it is to the other values.

The Mindcuber also has a white calibration. This is used to identify the white values and removed them from the list before sorting which is useful since white doesn't have a meaningful hue value.