remove zod

This commit is contained in:
Km.Van
2026-07-12 19:08:00 +08:00
parent b520ad7224
commit cf5d0455ec
+7 -11
View File
@@ -1,6 +1,4 @@
import z from "zod";
type Percentage = `${number}%`;
type Percentage = `${number}`; // 0-1
type Decimals = `${number}`; // 用于 Chroma (0-0.4) 或 Alpha (0-1)
type Hue = `${number}`; // Hue 角度 (0-360)
@@ -9,11 +7,9 @@ export type OklchColor =
| `oklch(${Percentage} ${Decimals} ${Hue} / ${Percentage})`
| `oklch(${Percentage} ${Decimals} ${Hue} / ${Decimals})`;
export const OklchObjectSchema = z.strictObject({
a: z.number().min(0).max(1),
c: z.number().min(0).max(0.4),
h: z.number().min(0).max(360),
l: z.number().min(0).max(100),
});
export type OklchObject = z.infer<typeof OklchObjectSchema>;
export type OklchObject = {
a: number;
c: number;
h: number;
l: number;
};