I am trying to implement a color temperature changing functionality in javascript (HTML5 canvas). From my research, I concluded that the best approach for this would be to convert RGB to LAB and then adjust the B component from LAB (A -> Tint & B -> Temperature)
However, I also implemented a code that converts degrees Kelvin to an RGB value . So I have both of my needed components; image data and my temperature.
My approach was to convert every pixel to LAB and the temperature RGB also to LAB and interpolate between those values. I just don't know if this is the right approach though.
Or is there a better way to apply temperature to an image based on a certain degrees Kelvin?