-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[Animated] Interpolation between hex-encoded colors is unsupported #1905
Comments
Yeah it looks like just rgba is supported right now, this would be nice to have though |
d3-interpolate combined with d3-color accomplishes this nicely, perhaps we should just pull d3-color in as a dependency? |
cc: @vjeux |
The way string interpolation is implemented right now is by looking for consecutive numbers and interpolating those. Super dumb but works okay. Would be nice to have a proper color parser :) Wanna send a pull request? |
@vjeux - are you OK with depending on d3-color? Should be easy if so |
i'd rather not. We already have color extraction in obj-c, java and this would add another way to interpret colors in js. What would be nice is to move color normalization in js this way we can share the logic. In the meantime, can you just add special support for #xxx and #xxxxxx? |
Maybe we could add a Color proptype instead of using strings for colors in js? then we could move all string->color conversion to the front-end, and send colors over the bridge as an array of numbers. |
To be clear, I'm not suggesting we'd stop using hex strings in the JS apps - just pre-convert them to an array before sending over bridge. |
👍 How important is this to you guys? Will support be added soon? |
Support will be added probably when someone contributes a PR. |
Do you guys not use React Native for animations? Or just using RGBA values? |
I think all the Facebook examples have used RGBA values. |
Color processing is now in JS so this should be easier to add (or maybe just works? haven't checked). |
This one is fixed now? ^^ #3177 |
Ex: setting the output range to
['#fff', '#2966fb']
.The text was updated successfully, but these errors were encountered: