Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There's two type definitions of Color instance #258

Closed
latin-1 opened this issue Dec 2, 2022 · 2 comments · Fixed by #259
Closed

There's two type definitions of Color instance #258

latin-1 opened this issue Dec 2, 2022 · 2 comments · Fixed by #259

Comments

@latin-1
Copy link
Contributor

latin-1 commented Dec 2, 2022

import Color from "colorjs.io";

const color1 = new Color("black"); // Color from "colorjs.io/types/src/index.d.ts"
const color2 = color1.to("srgb"); // Color "from colorjs.io/types/src/color.d.ts"

// @ts-expect-error Type 'Color' is missing the following properties from type 'Color': uv, xy, contrast, contrastWCAG21, and 18 more.
const color3: Color = color2;
@MysteryBlokHed
Copy link
Member

@MysteryBlokHed
Copy link
Member

Actually, I've looked at the code again and I can see what the problem is. I'm working on a PR that I think will fix it.

LeaVerou pushed a commit that referenced this issue Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants