Skip to content

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.

3 participants