Skip to content

Change all default_aes alpha from NA to 1 #2559

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

Merged
merged 1 commit into from
May 7, 2018

Conversation

thomasp85
Copy link
Member

@thomasp85 thomasp85 commented May 7, 2018

Fix #2558

This PR changes all the default values for the alpha aesthetic to 1 in the cases where it is currently set to NA. Any colour are currently passed through scales::alpha() if it should be modified with transparency and this function treats NA as 1, so there should be no practical effect of this change.

@thomasp85 thomasp85 requested a review from hadley May 7, 2018 20:48
@hadley hadley merged commit 45168b6 into tidyverse:master May 7, 2018
@thomasp85
Copy link
Member Author

I've gotten the visual tests up and running on my system now, and it seems that the issue is not as clear-cut. The prior NA default allowed colours to be specified with an alpha inside the colour string (eg #cc000044), while setting it to 1 will override any hard-coded transparency.

As this PR was brought in as a nicety for gganimate I suggest we roll it back. gganimate users will then have to specify alpha inside the layers if they want fading effects...

What do you think?

@clauswilke
Copy link
Member

Yes, please. I'd be very unhappy if I couldn't use RGBA colors anymore.

As an alternative to rolling this back, though, you could also modify the alpha function to apply its alpha value on top of any alpha already in the color.

@thomasp85
Copy link
Member Author

This was a sad oversight on my part, and I'm very much against breaking support for rgba.

I thought about modifying alpha in that way, but I think it would become too unpredictable - I'm doing a revert PR now, but open to making a change in scales::alpha() instead

@thomasp85 thomasp85 mentioned this pull request May 8, 2018
@clauswilke
Copy link
Member

Yes, I guess the question is whether scales::alpha() sets or modifies the alpha value. What would be the expected outcome of scales::alpha(scales::alpha("red", 0.5), 0.5)?

@thomasp85
Copy link
Member Author

I think it needs to set it if an alpha scale should ever make sense...

Anyway, my vote is firmly on revert - I think I can solve my own needs with some changes to tweenr and gganimate

@lock
Copy link

lock bot commented Nov 4, 2018

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Nov 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants