ITADN

deserialize() returns types any

#11Openskorphil 创建于 2024-12-30
S
skorphilcommented
```ts const { coords, id } = deserialize(colorStr); // coords: any, id: any ``` BTW its is not very convenient, that `id` returns lowercase color space instead of `keyof typeof import("@texel/color")` like `"OKLCH" | "OKLab" | "sRGB" | "OKLab_to" ...` because i try to use it like: ```ts const { coords, id } = deserialize(color) ... const convertedColor = convert( coords, colorSpace[id] // cant just use id here, have to write additional logic to convert srgb => sRGB, oklch => OKLCH etc. colorSpace[targetSpace] ); ```
2 条评论