Skip to content

postcss-gradients-interpolation-method : fix same color interpolation #918

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

Conversation

romainmenke
Copy link
Member

No description provided.

@romainmenke romainmenke force-pushed the postcss-gradients-interpolation-method--fix-same-color--reliable-galapagos-tortoise-9045364fe5 branch from 21d657e to 8659029 Compare April 3, 2023 11:45
Comment on lines +30 to +34
hueInterpolationMethod ||
(
serializeP3(colorStop.colorData, false).toString() !== serializeP3(nextColorStop.colorData, false).toString() &&
colorStop.position.toString() !== nextColorStop.position.toString()
)
Copy link
Member Author

@romainmenke romainmenke Apr 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the same color as start and end there isn't any effect when using shorter hue, or when interpolating between rectangular color spaces.
So I optimized this, but did so too aggressively.

For longer hue there is an actual gradient.
Rendering a color wheel is trivial with two color stops with the same color and using longer hue.

…same-color--reliable-galapagos-tortoise-9045364fe5
…same-color--reliable-galapagos-tortoise-9045364fe5
…same-color--reliable-galapagos-tortoise-9045364fe5
Copy link
Member

@Antonio-Laguna Antonio-Laguna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

…same-color--reliable-galapagos-tortoise-9045364fe5
@romainmenke romainmenke merged commit 9c431b9 into main Apr 9, 2023
@romainmenke romainmenke deleted the postcss-gradients-interpolation-method--fix-same-color--reliable-galapagos-tortoise-9045364fe5 branch April 9, 2023 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants