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

Should .toGamut() default to in place modification? #152

Closed
LeaVerou opened this issue Jun 22, 2022 · 1 comment
Closed

Should .toGamut() default to in place modification? #152

LeaVerou opened this issue Jun 22, 2022 · 1 comment

Comments

@LeaVerou
Copy link
Member

Right now:

// In place:
color.toGamut({inPlace: true});

// New object:
color.toGamut();

Having to pass {inPlace: true} is rather awkward. If we ditch this and default to mutating in place, the API is (IMO) much more elegant:

// In place:
color.toGamut();

// New object:
new Color(color).toGamut();

// or:
color.clone().toGamut();
@svgeesus
Copy link
Member

yes, that seems better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants