Skip to content
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

Merged
merged 13 commits into from
Apr 19, 2023

Conversation

kajkal
Copy link
Contributor

@kajkal kajkal commented Apr 11, 2023

Integration with changes from PR #94 from maplibre-style.

  • update color-related integration tests
  • add color-interpolation render tests

Launch Checklist

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • Briefly describe the changes in this PR.
  • Link to related issues.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality.
  • Document any changes to public APIs.
  • Post benchmark scores.
  • Add an entry to CHANGELOG.md under the ## main section.

@HarelM
Copy link
Member

HarelM commented Apr 14, 2023

@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?

@kajkal
Copy link
Contributor Author

kajkal commented Apr 14, 2023

Updated, colors (parsing/interpolation) are as expected, all tests are passing - it seems fine to me 👍

# Conflicts:
#	test/integration/expression/expression.test.ts
@HarelM
Copy link
Member

HarelM commented Apr 14, 2023

Any chance for a render test? So that this change could be visually seen?

@kajkal
Copy link
Contributor Author

kajkal commented Apr 14, 2023

Oh ok, those exist, I completely missed them and was only looking at the results of jest 😩

@kajkal kajkal marked this pull request as draft April 14, 2023 21:21
src/style/properties.ts Outdated Show resolved Hide resolved
@kajkal
Copy link
Contributor Author

kajkal commented Apr 16, 2023

As some render tests proved, there are cases in which an already parsed instance of Color class is passed to Color.parse function, contrary to my assumptions.
I created PR #128 - blocker for this PR - needs new maplibre-style-spec release as 19.0.0 is without this fix.

I added 2 render tests for color interpolation and added the ability to change the default sensitivity to color differences.
The tests in the previous configuration checked colors with a approximation: rgb(46,215,46) vs rgb(0,255,0) => pass.
By changing the sensitivity for tests directly related to colors, they are now able to detect a small change in the value of even one of the sRGB channels: rgb(28,199,255) vs rgb(28,200,255) => fail.

@drwestco
Copy link
Contributor

drwestco commented Apr 16, 2023 via email

@HarelM
Copy link
Member

HarelM commented Apr 18, 2023

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.

@kajkal
Copy link
Contributor Author

kajkal commented Apr 18, 2023

Thanks, I was not aware that this was possible!
I adjusted the threshold for my new color interpolation tests - It should be working now.

@HarelM
Copy link
Member

HarelM commented Apr 19, 2023

Generally approved, you'll need to set it for ready for review and resolve conflicts to have it merged.

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

Successfully merging this pull request may close these issues.

None yet

3 participants