import type { XyzColorValue } from "../types.ts" import { internalNormalizeXyzColorValue } from "./internal.ts" /** * @description 构造一个 XYZ 颜色值对象。 * * @example * ``` * // Expect: { x: 0.25, y: 0.3, z: 0.4, alpha: 1 } * const example1 = createXyzColorValue({ x: 0.25, y: 0.3, z: 0.4, alpha: 1 }) * * // Expect: { x: 0, y: 0, z: 0, alpha: 0.5 } * const example2 = createXyzColorValue({ x: 0, y: 0, z: 0, alpha: 0.5 }) * ``` */ export const createXyzColorValue = (color: XyzColorValue): XyzColorValue => { return internalNormalizeXyzColorValue(color) }