-
Notifications
You must be signed in to change notification settings - Fork 658
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
[css-images-4] Rendering gradients with missing color components #9295
Comments
I don't see how that conclusion follows from any specification text.
Exactly.
Not two stops exactly, but yes the color at that stop has different values on one side and the other (because |
So linear-gradient(in oklch, red, transparent, blue);
Right. And then the first segment interpolates Doing some hue interpolation between two adjacent stops would cause the hue to gradually change on both segments. |
Great, thanks! That clears everything up for me. Should we add an example to css-images-4 or just close this issue? |
Given that you initially came to a different interpretation, I think it makes sense to add a clarifying example to Images 4. |
clarification definitely needed, as I expected @mysteryDate's first example and will be surprised when it ends up being the 2nd one. I'll adjust my mental model |
@argyleink was there specific text wording that led you to that conclusion? |
Nah, just intent vs result. I can adapt to fit |
w3c/csswg-drafts#9295 I mistakenly thought earlier that missing parameters should resolve as if that parameter were not there. In fact it should effectively become two stops in the same spot, taking non-missing parameters from the left and right neighbors, respectively. If either neighbor is missing then the parameter resolves to zero. The test had to be updated. Bug: 1462612 Change-Id: Ie3c55d17117537052fa7cecb66bfd2b953952a38
w3c/csswg-drafts#9295 I mistakenly thought earlier that missing parameters should resolve as if that parameter were not there. In fact it should effectively become two stops in the same spot, taking non-missing parameters from the left and right neighbors, respectively. If either neighbor is missing then the parameter resolves to zero. The test had to be updated. Bug: 1462612 Change-Id: Ie3c55d17117537052fa7cecb66bfd2b953952a38 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4834550 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Aaron Krajeski <aaronhk@chromium.org> Cr-Commit-Position: refs/heads/main@{#1195374}
w3c/csswg-drafts#9295 I mistakenly thought earlier that missing parameters should resolve as if that parameter were not there. In fact it should effectively become two stops in the same spot, taking non-missing parameters from the left and right neighbors, respectively. If either neighbor is missing then the parameter resolves to zero. The test had to be updated. Bug: 1462612 Change-Id: Ie3c55d17117537052fa7cecb66bfd2b953952a38 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4834550 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Aaron Krajeski <aaronhk@chromium.org> Cr-Commit-Position: refs/heads/main@{#1195374}
w3c/csswg-drafts#9295 I mistakenly thought earlier that missing parameters should resolve as if that parameter were not there. In fact it should effectively become two stops in the same spot, taking non-missing parameters from the left and right neighbors, respectively. If either neighbor is missing then the parameter resolves to zero. The test had to be updated. Bug: 1462612 Change-Id: Ie3c55d17117537052fa7cecb66bfd2b953952a38 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4834550 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Aaron Krajeski <aaronhk@chromium.org> Cr-Commit-Position: refs/heads/main@{#1195374}
…or stops with missing parameters, a=testonly Automatic update from web-platform-tests Take neighboring values for gradient color stops with missing parameters w3c/csswg-drafts#9295 I mistakenly thought earlier that missing parameters should resolve as if that parameter were not there. In fact it should effectively become two stops in the same spot, taking non-missing parameters from the left and right neighbors, respectively. If either neighbor is missing then the parameter resolves to zero. The test had to be updated. Bug: 1462612 Change-Id: Ie3c55d17117537052fa7cecb66bfd2b953952a38 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4834550 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Aaron Krajeski <aaronhk@chromium.org> Cr-Commit-Position: refs/heads/main@{#1195374} -- wpt-commits: d5f48fa66a23af619da2c75f198cbf7c79110a9f wpt-pr: 41900
…or stops with missing parameters, a=testonly Automatic update from web-platform-tests Take neighboring values for gradient color stops with missing parameters w3c/csswg-drafts#9295 I mistakenly thought earlier that missing parameters should resolve as if that parameter were not there. In fact it should effectively become two stops in the same spot, taking non-missing parameters from the left and right neighbors, respectively. If either neighbor is missing then the parameter resolves to zero. The test had to be updated. Bug: 1462612 Change-Id: Ie3c55d17117537052fa7cecb66bfd2b953952a38 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4834550 Reviewed-by: Brian Osman <brianosmangoogle.com> Commit-Queue: Aaron Krajeski <aaronhkchromium.org> Cr-Commit-Position: refs/heads/main{#1195374} -- wpt-commits: d5f48fa66a23af619da2c75f198cbf7c79110a9f wpt-pr: 41900 UltraBlame original commit: e5003ff328895b7286e43560ed1f2e0365c7a89a
…or stops with missing parameters, a=testonly Automatic update from web-platform-tests Take neighboring values for gradient color stops with missing parameters w3c/csswg-drafts#9295 I mistakenly thought earlier that missing parameters should resolve as if that parameter were not there. In fact it should effectively become two stops in the same spot, taking non-missing parameters from the left and right neighbors, respectively. If either neighbor is missing then the parameter resolves to zero. The test had to be updated. Bug: 1462612 Change-Id: Ie3c55d17117537052fa7cecb66bfd2b953952a38 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4834550 Reviewed-by: Brian Osman <brianosmangoogle.com> Commit-Queue: Aaron Krajeski <aaronhkchromium.org> Cr-Commit-Position: refs/heads/main{#1195374} -- wpt-commits: d5f48fa66a23af619da2c75f198cbf7c79110a9f wpt-pr: 41900 UltraBlame original commit: e5003ff328895b7286e43560ed1f2e0365c7a89a
…or stops with missing parameters, a=testonly Automatic update from web-platform-tests Take neighboring values for gradient color stops with missing parameters w3c/csswg-drafts#9295 I mistakenly thought earlier that missing parameters should resolve as if that parameter were not there. In fact it should effectively become two stops in the same spot, taking non-missing parameters from the left and right neighbors, respectively. If either neighbor is missing then the parameter resolves to zero. The test had to be updated. Bug: 1462612 Change-Id: Ie3c55d17117537052fa7cecb66bfd2b953952a38 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4834550 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Aaron Krajeski <aaronhk@chromium.org> Cr-Commit-Position: refs/heads/main@{#1195374} -- wpt-commits: d5f48fa66a23af619da2c75f198cbf7c79110a9f wpt-pr: 41900
…or stops with missing parameters, a=testonly Automatic update from web-platform-tests Take neighboring values for gradient color stops with missing parameters w3c/csswg-drafts#9295 I mistakenly thought earlier that missing parameters should resolve as if that parameter were not there. In fact it should effectively become two stops in the same spot, taking non-missing parameters from the left and right neighbors, respectively. If either neighbor is missing then the parameter resolves to zero. The test had to be updated. Bug: 1462612 Change-Id: Ie3c55d17117537052fa7cecb66bfd2b953952a38 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4834550 Reviewed-by: Brian Osman <brianosmangoogle.com> Commit-Queue: Aaron Krajeski <aaronhkchromium.org> Cr-Commit-Position: refs/heads/main{#1195374} -- wpt-commits: d5f48fa66a23af619da2c75f198cbf7c79110a9f wpt-pr: 41900 UltraBlame original commit: e5003ff328895b7286e43560ed1f2e0365c7a89a
edit: Ignore me. I'm over-thinking this. The hue interpolation makes no difference in this case, because all the intermediate colors are achromatic as well. Move along - nothing to see here. |
w3c/csswg-drafts#9295 I mistakenly thought earlier that missing parameters should resolve as if that parameter were not there. In fact it should effectively become two stops in the same spot, taking non-missing parameters from the left and right neighbors, respectively. If either neighbor is missing then the parameter resolves to zero. The test had to be updated. Bug: 1462612 Change-Id: Ie3c55d17117537052fa7cecb66bfd2b953952a38 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4834550 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Aaron Krajeski <aaronhk@chromium.org> Cr-Commit-Position: refs/heads/main@{#1195374}
There is disagreement over interactions between the css-color-4 and css-images-4 specifications here: crbug.com/1462612. Specifically, what is the desired behavior color stops with missing components in gradients. For example:
linear-gradient(to right in srgb, color(srgb 1 0 0), color(srgb none 0 0), color(srgb 0 0 1)
Intuitively, I assumed that the red channel of the above gradient should interpolate as if the 2nd color stop were not there and thus would be a linear interpolation of the surrounding color stops:
linear-gradient(to right in srgb, color(srgb 1 0 0), color(srgb 0.5 0 0), color(srgb 0 0 1)
@brianosman Pointed out several things that are problematic with this approach at here:
From https://csswg.sesse.net/css-color-4/#interpolation-missing:
And from https://csswg.sesse.net/css-images-4/#coloring-gradient-line:
From these two things @brianosman concluded that the color of any point on a gradient should be fully determined neighboring color stops and that "none"s should be resolved by splitting into two color stops and interpolating with the neighbors, resulting in:
linear-gradient(to right in srgb, color(srgb 1 0 0), color(srgb 1 0 0) 50%, color(srgb 0 0 1) 50%, color(srgb 0 0 1)
This, to me, seems intuitively like the incorrect result. What is the correct behavior? Can we clarify the spec?
The text was updated successfully, but these errors were encountered: