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

[Animated] Interpolation between hex-encoded colors is unsupported #1905

Closed
ide opened this issue Jul 8, 2015 · 14 comments
Closed

[Animated] Interpolation between hex-encoded colors is unsupported #1905

ide opened this issue Jul 8, 2015 · 14 comments
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. JavaScript Resolution: Locked This issue was locked by the bot.

Comments

@ide
Copy link
Contributor

ide commented Jul 8, 2015

Ex: setting the output range to ['#fff', '#2966fb'].

@brentvatne
Copy link
Collaborator

Yeah it looks like just rgba is supported right now, this would be nice to have though

@brentvatne
Copy link
Collaborator

d3-interpolate combined with d3-color accomplishes this nicely, perhaps we should just pull d3-color in as a dependency?

@nicklockwood
Copy link
Contributor

cc: @vjeux

@vjeux
Copy link
Contributor

vjeux commented Jul 9, 2015

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?

@brentvatne
Copy link
Collaborator

@vjeux - are you OK with depending on d3-color? Should be easy if so

@vjeux
Copy link
Contributor

vjeux commented Jul 9, 2015

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?

@brentvatne brentvatne added the Good first issue Interested in collaborating? Take a stab at fixing one of these issues. label Jul 9, 2015
@nicklockwood
Copy link
Contributor

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.

@nicklockwood
Copy link
Contributor

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.

@aleclarson
Copy link
Contributor

👍 How important is this to you guys? Will support be added soon?

@ide
Copy link
Contributor Author

ide commented Aug 27, 2015

Support will be added probably when someone contributes a PR.

@aleclarson
Copy link
Contributor

Do you guys not use React Native for animations? Or just using RGBA values?

@ide
Copy link
Contributor Author

ide commented Aug 27, 2015

I think all the Facebook examples have used RGBA values.

@ide ide added the JavaScript label Sep 26, 2015
@ide
Copy link
Contributor Author

ide commented Sep 27, 2015

Color processing is now in JS so this should be easier to add (or maybe just works? haven't checked).

@dralletje
Copy link
Contributor

This one is fixed now? ^^ #3177

@vjeux vjeux closed this as completed Oct 7, 2015
@facebook facebook locked as resolved and limited conversation to collaborators Jul 22, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. JavaScript Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants