import { internalAssertAlpha, internalAssertNonNegativeFinite } from "../internal.ts" import type { XyzColorValue } from "../types.ts" /** * @description 规范化 XYZ 颜色值结构。 */ export const internalNormalizeXyzColorValue = (color: XyzColorValue): XyzColorValue => { internalAssertNonNegativeFinite(color.x, "Color channel x") internalAssertNonNegativeFinite(color.y, "Color channel y") internalAssertNonNegativeFinite(color.z, "Color channel z") internalAssertAlpha(color.alpha) return { x: color.x, y: color.y, z: color.z, alpha: color.alpha, } }