File tree Expand file tree Collapse file tree 3 files changed +24
-3
lines changed
Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 66
77* ` writeData() ` calls ` force(x) ` to evaluate the object before options are set ([ #264 ] ( https://github.com/ycphs/openxlsx/issues/264 ) )
88
9+ * ` tabColour ` in ` wb_add_worksheet() ` now allows passing ` wb_colour() ` . [ 500] ( https://github.com/JanMarvin/openxlsx2/pull/500 )
10+
911## Fixes
1012
1113* Reading of files with frozen panes and more than one section node was restored. [ 495] ( https://github.com/JanMarvin/openxlsx2/pull/495 )
2325* Do not export ` write_data2() ` anymore. This was used in development in the early stages of the package and should not be used directly anymore.
2426
2527
26-
2728***************************************************************************
2829
2930
Original file line number Diff line number Diff line change @@ -380,7 +380,11 @@ wbWorkbook <- R6::R6Class(
380380 )
381381
382382 if (! is.null(tabColour )) {
383- tabColour <- validateColour(tabColour , " Invalid tabColour in add_worksheet." )
383+ if (is_wbColour(tabColour )) {
384+ tabColour <- as.character(tabColour )
385+ } else {
386+ tabColour <- validateColour(tabColour , " Invalid tabColour in add_chartsheet." )
387+ }
384388 }
385389
386390 if (! is.numeric(zoom )) {
@@ -526,7 +530,11 @@ wbWorkbook <- R6::R6Class(
526530 }
527531
528532 if (! is.null(tabColour )) {
529- tabColour <- validateColour(tabColour , " Invalid tabColour in add_worksheet." )
533+ if (is_wbColour(tabColour )) {
534+ tabColour <- as.character(tabColour )
535+ } else {
536+ tabColour <- validateColour(tabColour , " Invalid tabColour in add_worksheet." )
537+ }
530538 }
531539
532540 if (! is.numeric(zoom )) {
Original file line number Diff line number Diff line change @@ -15,3 +15,15 @@ test_that("get()", {
1515 expect_equal(exp , got )
1616
1717})
18+
19+ test_that(" tabColour can be wb_colour()" , {
20+ expect_silent(
21+ wb_workbook()$
22+ # wb_colour
23+ add_worksheet(tabColour = wb_colour(" green" ))$
24+ add_chartsheet(tabColour = wb_colour(" green" ))$
25+ # colour name
26+ add_worksheet(tabColour = " green" )$
27+ add_chartsheet(tabColour = " green" )
28+ )
29+ })
You can’t perform that action at this time.
0 commit comments