Skip to content

Commit

Permalink
issue #415 line_color hex (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock authored Jan 13, 2025
1 parent 36b2315 commit 99bae23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Bugs:
* `save_tt("file.pdf")` works with colors. Thanks to @olivedv for the report and solution #395.
* `group_tt(i=vec)`: `vec` can be a factor vector
* `style_tt(align="d")` with empty strings (`modelsummary::datasummary_balance()` test)
* `style_tt(line_color)` accepts Hex codes. Thanks to @andrewheiss for report #415.
* `tt(rownames=TRUE)` should not add column names if they do not exist. Thanks to @Nowosad for report #414.

New:
Expand Down
7 changes: 5 additions & 2 deletions R/style_tabularray.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,11 @@ setMethod(
rec$line[idx] <- sty$line[row]
}

if (!is.na(sty$line_color[row])) {
rec$line_color[idx] <- sty$line_color[row]
lcol <- sty$line_color[row]
if (!is.na(lcol)) {
x <- color_to_preamble(x, lcol)
if (grepl("^#", lcol)) lcol <- sub("^#", "c", lcol)
rec$line_color[idx] <- lcol
}

if (!is.na(sty$line_width[row])) {
Expand Down

0 comments on commit 99bae23

Please sign in to comment.