public static float[] temperatureToRGB(int degreesK){
  int k=MathUtils.constrain(degreesK,1000,20000);
  float a=(k % 100) / 100.0f;
  int i=((k - 1000) / 100) * 3;
  return new float[]{interp(i,a),interp(i + 1,a),interp(i + 2,a)};
}

public static float [ ] temperatureToRGB ( int degreesK ) { int k = MathUtils . constrain ( degreesK , 1000 , 20000 ) ; float a = ( k % 100 ) / 100.0f ; int i = ( ( k - 1000 ) / 100 ) * 3 ; return new float [ ] { interp ( i , a ) , interp ( i + 1 , a ) , interp ( i + 2 , a ) } ; }
convert a color temperature value ( in kelvin ) to a rgb units as floats . this can be used in a transform matrix or hardware gamma control .
