Skip to content

Ink and paper settings for built-in themes#6059

Closed
teunbrand wants to merge 52 commits intotidyverse:mainfrom
teunbrand:theme_ink
Closed

Ink and paper settings for built-in themes#6059
teunbrand wants to merge 52 commits intotidyverse:mainfrom
teunbrand:theme_ink

Conversation

@teunbrand
Copy link
Copy Markdown
Collaborator

This PR aims to fix an issue discussed during conf.

Briefly, treading in the footsteps of #5833, we give ink and paper argument to built-in themes.

The ink sets all foreground elements, which by default is 'black'. Likewise, paper sets all background elements, which by default is 'white'.

Some examples of non-default options:

Changing the foreground

devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2
p <- ggplot(mpg, aes(displ, hwy)) +
  geom_point()

p + theme_bw(ink = "dodgerblue")

Changing the background

p + theme_gray(paper = "orchid")

Cheap dark-mode option

p + theme_light(ink = "white", paper = "black")

Created on 2024-08-26 with reprex v2.1.1

teunbrand and others added 30 commits April 5, 2024 15:47
Merge branch 'main' into theme_geom_defaults

# Conflicts:
#	R/geom-.R
#	R/geom-sf.R
Co-authored-by: Thomas Lin Pedersen <thomasp85@gmail.com>
Merge branch 'main' into theme_geom_defaults

# Conflicts:
#	R/theme-elements.R
#	R/theme.R
#	man/theme.Rd
@teunbrand
Copy link
Copy Markdown
Collaborator Author

Closing this in favour of #6063

@teunbrand teunbrand closed this Aug 27, 2024
teunbrand added a commit that referenced this pull request Sep 13, 2024
* abstract away theme colours

* add snapshot test

* add news bullet
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.

2 participants