From a65f1a8124bc3e2d93d9ef3510085bcb35a7113e Mon Sep 17 00:00:00 2001 From: Tycho Tatitscheff Date: Thu, 23 Nov 2023 18:31:26 +0100 Subject: [PATCH] wip: try upgrade polynomial approximation --- src/gamut/rgb/oklab.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/gamut/rgb/oklab.ts b/src/gamut/rgb/oklab.ts index 74aab90..2440005 100644 --- a/src/gamut/rgb/oklab.ts +++ b/src/gamut/rgb/oklab.ts @@ -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;