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

module 'webcolors' has no attribute 'CSS3_NAMES_TO_HEX' #115

Closed
kevinlinxc opened this issue Jul 10, 2024 · 2 comments · Fixed by #117 or #118
Closed

module 'webcolors' has no attribute 'CSS3_NAMES_TO_HEX' #115

kevinlinxc opened this issue Jul 10, 2024 · 2 comments · Fixed by #117 or #118
Assignees
Labels
bug Something isn't working

Comments

@kevinlinxc
Copy link

kevinlinxc commented Jul 10, 2024

When I try to import ms3, I get this error:

    411 MS3_COLORS = list(MS3_HTML.values())
    412 CSS2MS3 = {c[4:]: c for c in MS3_COLORS}
--> 413 CSS_COLORS = list(webcolors.CSS3_NAMES_TO_HEX.keys())
    414 COLORS = sum([[c, CSS2MS3[c]] if c in CSS2MS3 else [c] for c in CSS_COLORS], [])
    415 rgba = namedtuple("RGBA", ["r", "g", "b", "a"])

AttributeError: module 'webcolors' has no attribute 'CSS3_NAMES_TO_HEX'

ms3 version 2.5.1
webcolors version 24.6.0

@kevinlinxc kevinlinxc added the bug Something isn't working label Jul 10, 2024
@kevinlinxc
Copy link
Author

I changed the line to
CSS_COLORS = list(webcolors._definitions._CSS3_NAMES_TO_HEX.keys())

and it works now but maybe downgrading or pinning a version would be easier

@johentsch
Copy link
Owner

Thanks for reporting the fix, @kevinlinxc. I will fix this eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants