Skip to content

Commit

Permalink
adjust t_xyz2lab for correct temperature of 6504K
Browse files Browse the repository at this point in the history
  • Loading branch information
vadim-160102 authored and mohawk2 committed Jan 23, 2022
1 parent 9b55b2a commit 3b13d1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/PDL/Transform/Color.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,7 @@ sub xyy_from_D {
$u_opt);

die "cie_xy_from_D: D must be between 40 and 250" if(any($D< 40) || any($D > 250));
my $T = $D*100;
my $T = $D*100 * 1.4388/1.438; # adjust for 6504K not 6500K

my $Xd;
$Xd = ($D<=70) * ( 0.244063 + 0.09911e3/$T + 2.9678e6/$T/$T - 4.6070e9/$T/$T/$T ) +
Expand Down
2 changes: 1 addition & 1 deletion t/color.t
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,6 @@ eval {$t = t_xyz2lab();};
is $@, '', "t_xyz2lab ran OK";
eval {$b=pdl(1,1,1)->apply($t);};
is $@, '', "t_xyz2lab applied OK";
ok all(approx $b, pdl(100, 8.5841461, 5.5183538)), 't_xyz2lab right values' or diag "got=$b";
ok all(approx $b, pdl(100, 8.5859237, 5.5509345)), 't_xyz2lab right values' or diag "got=$b";

done_testing;

0 comments on commit 3b13d1b

Please sign in to comment.