-
-
Notifications
You must be signed in to change notification settings - Fork 659
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
Add CSS Color 4 syntax support - integration with changes from maplibre-style #2376
Conversation
@kajkal can you try and update the branch here and let me know if everything is working as expected in terms of updating the spec version? |
Updated, colors (parsing/interpolation) are as expected, all tests are passing - it seems fine to me 👍 |
# Conflicts: # test/integration/expression/expression.test.ts
Any chance for a render test? So that this change could be visually seen? |
Oh ok, those exist, I completely missed them and was only looking at the results of |
As some render tests proved, there are cases in which an already parsed instance of I added 2 render tests for color interpolation and added the ability to change the default sensitivity to color differences. |
You can use the 'keyof typeof' syntax here instead of string literals, so
it keeps working when new interpolatable types are added. If we run into
more cases needing the interpolationType, we can then consider a change in
the style spec repo.
…On Sun, Apr 16, 2023, 2:19 PM Karol Leśniak ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/style/properties.ts
<#2376 (comment)>
:
> @@ -483,9 +483,10 @@ export class DataConstantProperty<T> implements Property<T, T> {
}
interpolate(a: T, b: T, t: number): T {
- const interp: any = interpolateFactory(this.specification.type as any);
- if (interp) {
- return interp(a, b, t);
+ const interpolationType = this.specification.type as 'number' | 'color' | 'array' | 'padding';
Yes, you are right. This change would now require a separate PR to
maplibre-gl-style-spec because I read your comment too late, so I'm not
sure if it's worth it for those 2 repetitions - what do you think?
—
Reply to this email directly, view it on GitHub
<#2376 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVM5SY75IHJBZLUYRC4YDXBRO6NANCNFSM6AAAAAAWZVR43Y>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
test/integration/render/tests/background-color/colorSpace-hcl/style.json
Outdated
Show resolved
Hide resolved
test/integration/render/tests/background-color/colorSpace-lab/style.json
Outdated
Show resolved
Hide resolved
Seems like there's a render test that is failing. Note that I have recently added some instructions on how to get an image from the CI to get the test passing. There is a report that should be attached to the CI run, you can get it by going to the actions tab here in github, I believe. |
Thanks, I was not aware that this was possible! |
This reverts commit d968c4c
Generally approved, you'll need to set it for ready for review and resolve conflicts to have it merged. |
# Conflicts: # CHANGELOG.md
Integration with changes from PR #94 from maplibre-style.
Launch Checklist
CHANGELOG.md
under the## main
section.