Convert functions to expressions; add interpolation color spaces #5812
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Convert functions to expressions for evaluation (reverses #5379). Adds support for interpolate-hcl and interpolate-lab expression operators to replace the colorSpace function property (fixes #5326). Switches to shortest-path interpolation for HCL (fixes #5811).
Evaluation of converted expressions is slightly faster:
https://bl.ocks.org/anonymous/raw/ea7442aff28940abb9a358501aa9067b/
However, conversion+creation is slower. I may try to reimplement conversion to directly construct expression instances, rather than converting to a JSON representation.
https://bl.ocks.org/anonymous/raw/63b5d4b704f55e8e50dd5871297a1490/
What's still not working currently is the
default
property for functions. @anandthakker, I noticed the function tests for this were skipped. It looks like the skips were added as part of #4777. Do you recall if we ever came up with a plan for how to convertdefault
s into expression syntax?