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

Color constructor should handle argument as immutable #590

Open
bennyschudel opened this issue Aug 26, 2024 · 1 comment
Open

Color constructor should handle argument as immutable #590

bennyschudel opened this issue Aug 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@bennyschudel
Copy link

Hey there!

I was surprised to figure out that a call to new Color({ ... }) modifies my provided object by adding the space to it.

image

I guess this is a 🪲

Best
Benny

@LeaVerou
Copy link
Member

Ah yeah, it should copy the object, at least when it needs to be modified. Especially since perf is not a huge consideration with the OOP API.

@LeaVerou LeaVerou added the bug Something isn't working label Aug 27, 2024
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

No branches or pull requests

2 participants