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

[toGamut] Ensure toGamut always returns a color object #290

Merged
merged 1 commit into from
Mar 1, 2023

Conversation

lloydk
Copy link
Collaborator

@lloydk lloydk commented Mar 1, 2023

Calling toGamut() with a color that is already in gamut for the specified color space would return the original color parameter which may or may not be a color object.

For example calling toGamut("red", "oklch") would return "red" instead of a color object.

This change ensures that a color object will always be returned.

Calling toGamut with a color that is already in gamut
for the specified color space would return the original
color parameter which may or may not be a color object.

For example calling toGamut("red", "oklch") would return "red"
instead of a color object.

This change ensures that a color object will always be returned.
@LeaVerou LeaVerou merged commit cf124a4 into color-js:main Mar 1, 2023
@LeaVerou
Copy link
Member

LeaVerou commented Mar 1, 2023

Nice catch, thanks!

@lloydk lloydk deleted the fix-to-gamut branch March 15, 2024 05:26
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 this pull request may close these issues.

2 participants