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 < 1 in background color no longer works in column_spec() #852

Open
fornaeffe opened this issue Jun 23, 2024 · 3 comments
Open

Alpha < 1 in background color no longer works in column_spec() #852

fornaeffe opened this issue Jun 23, 2024 · 3 comments

Comments

@fornaeffe
Copy link

Describe the bug
Until a few days ago, all worked fine. Since yesterday (maybe after an update of some packages) colors specified by column_spec( background = "...") are rendered fully opaque even if I specify alpha < 1.

To Reproduce

---
title: "Test"
format: html
---


```{r}
library(kableExtra)

df <- data.frame(
  column1 = c("cell1", "cell2"),
  column2 = c("cell3", "cell4")
)

kbl(df, "html") %>%
  kable_minimal() %>%
  column_spec(1, background = "#00FF0010")
```

image

This is my session info:

R version 4.4.1 (2024-06-14 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 22631)

Matrix products: default


locale:
[1] LC_COLLATE=Italian_Italy.utf8  LC_CTYPE=Italian_Italy.utf8    LC_MONETARY=Italian_Italy.utf8
[4] LC_NUMERIC=C                   LC_TIME=Italian_Italy.utf8    

time zone: Europe/Rome
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] kableExtra_1.4.0

loaded via a namespace (and not attached):
 [1] vctrs_0.6.5       svglite_2.1.3     cli_3.6.2         knitr_1.47        rlang_1.1.4      
 [6] xfun_0.45         stringi_1.8.4     highr_0.11        pkgload_1.3.4     formattable_0.2.1
[11] jsonlite_1.8.8    glue_1.7.0        colorspace_2.1-0  htmltools_0.5.8.1 sass_0.4.9       
[16] scales_1.3.0      rmarkdown_2.27    jquerylib_0.1.4   evaluate_0.24.0   munsell_0.5.1    
[21] fastmap_1.2.0     lifecycle_1.0.4   stringr_1.5.1     compiler_4.4.1    htmlwidgets_1.6.4
[26] rstudioapi_0.16.0 systemfonts_1.1.0 digest_0.6.35     viridisLite_0.4.2 R6_2.5.1         
[31] parallel_4.4.1    magrittr_2.0.3    bslib_0.7.0       tools_4.4.1       cachem_1.1.0     
[36] xml2_1.3.6 
@dmurdoch
Copy link
Collaborator

Your document looks like a Quarto document. Is it?

@fornaeffe
Copy link
Author

Yes it is

@dmurdoch
Copy link
Collaborator

That may be your problem. kableExtra was written for R Markdown. It's gradually being adapted to also work with Quarto, but that work is not complete. Since kableExtra hasn't had a release since January, it's likely a Quarto change (or some other package) that caused the issue.

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

No branches or pull requests

2 participants