Skip to content

Commit

Permalink
wip: try upgrade polynomial approximation
Browse files Browse the repository at this point in the history
  • Loading branch information
tychota committed Nov 23, 2023
1 parent 06f0a06 commit a65f1a8
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/gamut/rgb/oklab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,31 +117,31 @@ export abstract class OkLabInterpolateGamutMapping extends OkLabGamutMapping {

if (-1.8817030993265862 * a - 0.8093650129914288 * b > 1) {
// Red component goes under zero first
k0 = +1.19086277;
k1 = +1.76576728;
k2 = +0.59662641;
k3 = +0.75515197;
k4 = +0.56771245;
k0 = +1.2334704415913271;
k1 = +1.761351995693893;
k2 = +0.5542481838071837;
k3 = +0.7556095399535735;
k4 = +0.5721039642854463;
wl = +4.0767416360759592;
wm = -3.3077115392580625;
ws = +0.2309699031821046;
} else if (1.8144407988011 * a - 1.1944526678052367 * b > 1) {
// Green component goes under zero first
k0 = +0.73956515;
k1 = -0.45954404;
k2 = +0.08285427;
k3 = +0.1254107;
k4 = +0.14503204;
k0 = +0.7385344643416312;
k1 = -0.4602573851086104;
k2 = +0.0814153414715404;
k3 = +0.1299208728081628;
k4 = +0.1497697002866260;
wl = -1.2684379732850315;
wm = +2.6097573492876882;
ws = -0.3413193760026572;
} else {
// Blue component goes under zero first
k0 = +1.35733652;
k1 = -0.00915799;
k2 = -1.1513021;
k3 = -0.50559606;
k4 = +0.00692167;
k0 = +1.3590679989582644;
k1 = -0.0046797266360291;
k2 = -1.1529380158175064;
k3 = -0.5071027666728768;
k4 = +0.0028881806843376;
wl = -0.0041960761386755;
wm = -0.7034186179359361;
ws = +1.7076146940746113;
Expand Down

0 comments on commit a65f1a8

Please sign in to comment.