w3c / w3c/csswg-drafts

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

Open
#3,931 15 comments 0 reactions 2 assignees View on GitHub

@AmeliaBR is already working on this.

Since May 22, 2019.

css-images-4 Needs Edits
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.