feat: add non-destructive adjustment layers
This commit is contained in:
10
platform/browser/adjustment.test.ts
Normal file
10
platform/browser/adjustment.test.ts
Normal 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]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user