Skip to content

[css-color] blend() percentages are inverted? #2195

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

Closed
jonathantneal opened this issue Jan 17, 2018 · 0 comments
Closed

[css-color] blend() percentages are inverted? #2195

jonathantneal opened this issue Jan 17, 2018 · 0 comments

Comments

@jonathantneal
Copy link
Contributor

Are the instructions for blending colors inverted?

According to the color-mod() spec:

color-mod() = color( [ <color> | <hue> ] <color-adjuster>* )

The first argument specifies the base color... After the base color, zero or more <color-adjuster>s can be specified. Each <color-adjuster> modifies the color in some way, passing a new base color to the next <color-adjuster> in the list.

Then later, according to the blend() spec:

blend( <color> <percentage> [rgb | hsl | hwb]? )

To determine the resulting color... linearly interpolate each of the channels of the colors according to the given <percentage>, where 0% produces the specified <color> and 100% produces the base color.

This seems backwards. For example:

color-mod(blue blend(red 100%))

In this example the base color is blue and is blended with red at 100%, which produces ... blue?

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

No branches or pull requests

1 participant