studioimaginaire / phue

A Python library for the Philips Hue system
Other
1.52k stars 267 forks source link

Fix RGB to XY color calculation #208

Open BillClinton opened 10 months ago

BillClinton commented 10 months ago

The value of 'y' is being calculated incorrectly because it is using an x value that has been modified on the previous line when it should be using the value of x as it existed after the conversion from rgb. This update uses capital X Y Z variables to avoid this, following the example of the original formulas cited in the comments: https://gist.github.com/popcorn245/30afa0f98eea1c2fd34d