feat: add public ColorArea components, docs, and package contract

This commit is contained in:
maoyingjie
2026-10-26 23:51:31 +08:00
parent 01882160e6
commit ae364578ce
33 changed files with 2201 additions and 151 deletions
+12 -2
View File
@@ -171,9 +171,19 @@ describe("immutable private color value boundary", () => {
});
it("resolves legal space defaults and rejects duplicate/mismatched axes", () => {
expect(colorAxes(parseColor("#f00"))).toMatchObject({
space: "rgb",
x: "red",
y: "green",
});
expect(colorAxes(parseColor("hsl(200, 50%, 50%)"))).toMatchObject({
space: "hsl",
x: "hue",
y: "saturation",
});
expect(colorAxes(parseColor("hsb(240, 50%, 50%)"))).toMatchObject({
space: "hsb",
x: "saturation",
y: "brightness",
x: "hue",
y: "saturation",
});
expect(colorAxes(parseColor("#f00"), "rgb")).toMatchObject({
x: "red",