%CCT=7000K~25000K
CCT= CCT-200;
if CCT<7000
Xt=-4.607*(10^9/CCT^3)+2.9678*(10^6/CCT^2)+0.09911*(10^3/CCT)+0.244063;
Yt=-3*Xt^2+2.87*Xt-0.275;
else
Xt=-2.0064*(10^9/CCT^3)+1.9018*(10^6/CCT^2)+0.24748*(10^3/CCT)+0.237040;
Yt=-3*Xt^2+2.87*Xt-0.275;
end
%三原色的色品坐标
Xr=0.6894;
Yr=0.3049;
Xg=0.1763;
Yg=0.7248;
Xb=0.1370;
Yb=0.0663;
a=1/Yr;b=1/Yg;c=1/Yb;d=Xr/Yr;
e=Xg/Yg;f=Xb/Yb;h=1/Yt;i=Xt/Yt;
x=(i-d)*(c-a)-(h-a)*(f-d);
y=(e-d)*(c-a)-(b-a)*(f-d);
z=(i-d)*(b-a)-(h-a)*(e-d);
w=(f-d)*(b-a)-(c-a)*(e-d);
Kg=x/y;Kb=z/w;Kr=1-Kg-Kb;
r=Kr*120*65535/374.8[L1] *0.8;
g=Kg*120*65535/795.8[L2] *0.8;
b=Kb*120*65535/113.3[L3] *0.8;
[L1]原红色亮度,Lr
[L2]原绿色亮度,Lg
[L3]原蓝色亮度,Lb