feat: add non-destructive adjustment layers

This commit is contained in:
syntaxbullet
2026-07-11 12:31:06 +02:00
parent b928fb599b
commit 606426c885
30 changed files with 427 additions and 49 deletions

View File

@@ -0,0 +1,10 @@
import { describe, expect, test } from "bun:test";
import { adjustPixel } from "./exportArtboardPng";
import { neutralColorAdjustment } from "@core/adjustment-layer";
describe("adjustment pixel calculation", () => {
test("neutral adjustment is stable", () => expect(adjustPixel([20, 100, 220], neutralColorAdjustment)).toEqual([20, 100, 220]));
test("brightness, contrast, saturation and balance use deterministic ordering", () => {
expect(adjustPixel([100, 120, 140], { brightness: .1, contrast: .2, saturation: -.5, colorBalance: { red: .1, green: 0, blue: -.1 } })).toEqual([153, 150, 146]);
});
});