feat: establish shared color state and area interaction foundation
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import {
|
||||
parseColor,
|
||||
type ColorValue,
|
||||
} from "../../packages/vue/src/components/color/value";
|
||||
import type { ColorAreaOptions } from "../../packages/vue/src/components/color/area";
|
||||
const color = parseColor("hsb(240,50%,50%)");
|
||||
const value: ColorValue = color.withAlpha(0.5).toFormat("rgb");
|
||||
const options: ColorAreaOptions = {
|
||||
colorSpace: "rgb",
|
||||
xChannel: "blue",
|
||||
yChannel: "red",
|
||||
};
|
||||
void value;
|
||||
void options;
|
||||
// @ts-expect-error nonexistent channel
|
||||
color.withChannelValue("opacity", 1);
|
||||
// @ts-expect-error unsupported color format
|
||||
color.toString("oklch");
|
||||
// @ts-expect-error two-dimensional area axes exclude alpha
|
||||
const alpha: ColorAreaOptions = { xChannel: "alpha" };
|
||||
// @ts-expect-error no arbitrary foreign mutable plain object as library model
|
||||
const foreign: ColorValue = { space: "rgb", r: 0, g: 0, b: 0, alpha: 1 };
|
||||
void alpha;
|
||||
void foreign;
|
||||
Reference in New Issue
Block a user