-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Expose "parseColor" method on style spec package #4018
Comments
Just exposing this method will probably lead to some unexpected, since it uses a cache. Modifying the output will modify future output for the same input. parseColor is a pretty thin wrapper around |
@tmcw good catch. Would changing it to return a deep copy of the value from the cache be a bad idea? Do we have a benchmark set up to test the performance impact of a copy? If that isn't a good route, looks like |
Users who want to use the
function
method on the style spec package sometimes need to parse colors too (see https://www.mapbox.com/mapbox-gl-js/example/data-join/). We could make their workflow easier and more consistent by exposing our implementation ofparseColor
on the style spec package.cc @kronick @ryanbaumann
The text was updated successfully, but these errors were encountered: