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

[style] further tweaking of theme colors #940

Merged
merged 2 commits into from Feb 14, 2024
Merged

Conversation

JanMarvin
Copy link
Owner

@JanMarvin JanMarvin commented Feb 14, 2024

library(openxlsx2)

clr_xml <- create_colors_xml()

wb <- wb_workbook()$
  set_base_colors(xml = clr_xml)$
  add_worksheet()$
  add_fill(dims = "A1", color = wb_color(theme = 4))$
  add_fill(dims = "B1", color = wb_color(theme = 5))$
  add_fill(dims = "C1", color = wb_color(theme = 6))$
  add_fill(dims = "D1", color = wb_color(theme = 7))$
  add_fill(dims = "E1", color = wb_color(theme = 8))$
  add_fill(dims = "F1", color = wb_color(theme = 9))$
  add_fill(dims = "G1", color = wb_color(theme = 10))

wb$get_base_colors(xml = FALSE)
#> $`Base R`
#>      a:dk1      a:lt1      a:dk2      a:lt2  a:accent1  a:accent2  a:accent3 
#>  "#000000"  "#FFFFFF"  "#00008B"  "#D3D3D3"  "#DF536B"  "#61D04F"  "#2297E6" 
#>  a:accent4  a:accent5  a:accent6    a:hlink a:folHlink 
#>  "#28E2E5"  "#CD0BBC"  "#F5C710"  "#0000FF"  "#BEBEBE"

if (interactive()) wb$open()
Screenshot 2024-02-14 at 20 03 47

And now we make use of barplot() with wb_get_base_colors():
Screenshot 2024-02-14 at 20 04 13

@JanMarvin JanMarvin merged commit d94073b into main Feb 14, 2024
9 checks passed
@JanMarvin JanMarvin deleted the wb_set_base_colors_pt2 branch February 14, 2024 19:08
@JanMarvin
Copy link
Owner Author

Guess that was the last one for 1.4, @olivroy . It has become a quite big release:

  • pivot table formulas
  • new theme
  • theme colors
  • various fixes and improvements all over the place

I'm planning to do the release either tomorrow or Friday morning.

@olivroy
Copy link
Collaborator

olivroy commented Feb 14, 2024

Bravo for all the work! I did some pretty light testing ! Looks good. Just sending a quick PR to address some things I tripped on while doing my testing

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

Successfully merging this pull request may close these issues.

None yet

2 participants