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

Allow for scaling aesthetic alpha independently of rgb #102

Open
anthonynorth opened this issue Oct 19, 2023 · 0 comments
Open

Allow for scaling aesthetic alpha independently of rgb #102

anthonynorth opened this issue Oct 19, 2023 · 0 comments
Labels
feature New feature or request

Comments

@anthonynorth
Copy link
Member

Allow for scaling aesthetic alpha channel independently of rgb channels. This would allow for representing feature colours with 2 variables, allowing for emphasising / deemphasising features via alpha.

This is currently only doable via a bit of a hack: set alpha at some low opacity, then replicate features according to some variable. Stacking transparent features makes them more opaque. This works but it's a bit fiddly and makes maps slower.

Possible api:

rdeck() |>
  add_x_layer(
    ...,
    get_fill_color = scale_color_power(foo),
    # fill alpha is linearly scaled by `bar`, to output range [0.5, 1]
    get_fill_color_alpha = scale_linear(bar, limits = c(0.5, 1))
  )
@anthonynorth anthonynorth added the feature New feature or request label Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant