Skip to content

[Gamut mapping app] Scale LH improvements #438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
3 changes: 3 additions & 0 deletions apps/gamut-mapping/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ const methods = {
label: "Scale LH",
description: "Runs Scale, sets L, H to those of the original color, then runs Scale again.",
compute: (color) => {
if (color.inGamut("p3", { epsilon: 0 })) {
return color;
}
let mappedColor = methods.scale.compute(color);
let lch = color.to("oklch").coords;
mappedColor.set({
Expand Down