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

Alpha setting for color not used #129

Open
januz opened this issue Apr 24, 2020 · 3 comments
Open

Alpha setting for color not used #129

januz opened this issue Apr 24, 2020 · 3 comments

Comments

@januz
Copy link

januz commented Apr 24, 2020

Describe the bug

Huxtable does not use alpha setting a given color in HTML output.

Minimal Reproducible Example

---
title: "Transparent color test"
output: html_document
---

color <- rgb(255/255, 182/255, 0/255, 1)
color_transparent <- rgb(255/255, 182/255, 0/255, 0.3)

huxtable::hux(a = 1:5, b = 1:5) %>% 
  huxtable::set_background_color(
    1, huxtable::everywhere, color
  )

huxtable::hux(a = 1:5, b = 1:5) %>% 
  huxtable::set_background_color(
    1, huxtable::everywhere, color_transparent
  )

Expected behavior

The color should be transparent in the second table.

System details

Huxtable: 4.7.1.9000
R: 3.6.0
RStudio: 1.2.1163

@hughjonesd
Copy link
Owner

Interesting. Supporting this in HTML would be not too hard. In LaTeX it would be a pain, judging by https://tex.stackexchange.com/questions/45596/how-to-specify-transparent-colors . I think this is a reasonable feature request; what's the use case?

@januz
Copy link
Author

januz commented Apr 28, 2020

Thank you for looking into this! My main use case would be to use a color that isn't "too intense" as the background color for column headers (and aggregating bottom rows). Personally, I am mostly interested in a HTML solution, but maybe the transparent LaTeX package would work? Or maybe this workaround (mixing the color with white)?

@hughjonesd
Copy link
Owner

hughjonesd commented Apr 28, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants