function blindMK(rgb, t) {
const gamma = 2.2;
const wx = 0.312713;
const wy = 0.329016;
const wz = 0.358271;
const b = rgb[2];
const g = rgb[1];
const r = rgb[0];
const cr = powGammaLookup[r];
const cg = powGammaLookup[g];
const cb = powGammaLookup[b];
const cx = 0.430574 * cr + 0.34155 * cg + 0.178325 * cb;
const cy = 0.222015 * cr + 0.706655 * cg + 0.07133 * cb;
const cz = 0.020183 * cr + 0.129553 * cg + 0.93918 * cb;
const sum_xyz = cx + cy + cz;
let cu = 0;
let cv = 0;
if (sum_xyz != 0) {
cu = cx / sum_xyz;
cv = cy / sum_xyz;
}
const nx = (wx * cy) / wy;
const nz = (wz * cy) / wy;
let clm;
const dy = 0;
if (cu < rBlind[t].cpu) {
clm = (rBlind[t].cpv - cv) / (rBlind[t].cpu - cu);
} else {
clm = (cv - rBlind[t].cpv) / (cu - rBlind[t].cpu);
}
const clyi = cv - cu * clm;
const du = (rBlind[t].ayi - clyi) / (clm - rBlind[t].am);
const dv = clm * du + clyi;
const sx = (du * cy) / dv;
const sy = cy;
const sz = ((1 - (du + dv)) * cy) / dv;
let sr = 3.063218 * sx - 1.393325 * sy - 0.475802 * sz;
let sg = -0.969243 * sx + 1.875966 * sy + 0.041555 * sz;
let sb = 0.067871 * sx - 0.228834 * sy + 1.069251 * sz;
const dx = nx - sx;
const dz = nz - sz;
const dr = 3.063218 * dx - 1.393325 * dy - 0.475802 * dz;
const dg = -0.969243 * dx + 1.875966 * dy + 0.041555 * dz;
const db = 0.067871 * dx - 0.228834 * dy + 1.069251 * dz;
const adjr = dr ? ((sr < 0 ? 0 : 1) - sr) / dr : 0;
const adjg = dg ? ((sg < 0 ? 0 : 1) - sg) / dg : 0;
const adjb = db ? ((sb < 0 ? 0 : 1) - sb) / db : 0;
const adjust = Math.max(
adjr > 1 || adjr < 0 ? 0 : adjr,
adjg > 1 || adjg < 0 ? 0 : adjg,
adjb > 1 || adjb < 0 ? 0 : adjb
);
sr = sr + adjust * dr;
sg = sg + adjust * dg;
sb = sb + adjust * db;
return [inversePow(sr), inversePow(sg), inversePow(sb)];
}