Skip to content

[css-images-4] Color stop fixup: do interpolation hints function as positioned color stops? #3931

@danburzo

Description

@danburzo

I'm looking at adding support for color stop positions and interpolation hints to a color library I've been working on, and it's not clear for me from the spec: when fixing up color stops, and we spread color stops missing a position position evenly between the color stops which have one:

  1. If any color stop still does not have a position, then, for each run of adjacent color stops without positions, set their positions so that they are evenly spaced between the preceding and following color stops with positions.

...do the color hints count as color stops in step 3 of the process?

Here's my library's interpretation (top) vs. browser interpretation (bottom) of the following gradient:

linear-gradient(to right, blue, red, 50%, green)

Screenshot 2019-05-14 at 15 32 28

Is it normal that by introducing a color hint between red and green, the position of red shifts from 0.5 to 0.25? My mental model for the process resembled Photoshop's behavior, where moving the midpoints between two stops would not alter the position of the stops.

Screenshot 2019-05-14 at 15 46 37

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions