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

Ink and paper settings for built-in themes (re: #6059) #6063

Merged
merged 4 commits into from
Sep 13, 2024

Conversation

teunbrand
Copy link
Collaborator

This PR reimplements #6059 due to a gnarly git history that I couldn't manage to resolve.
The reasoning for this PR remains unchanged, but I'll post the examples again so that you can see that these are the same:

devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2

p <- ggplot(mpg, aes(displ, hwy)) +
  geom_point()

p + theme_bw(ink = "dodgerblue")

p + theme_gray(paper = "orchid")

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

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

@teunbrand teunbrand changed the title Ink and paper settigns for built-in themes (re: #6059) Ink and paper settings for built-in themes (re: #6059) Aug 27, 2024
Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -154,14 +156,14 @@ theme_grey <- function(base_size = 11, base_family = "",
axis.line = element_blank(),
axis.line.x = NULL,
axis.line.y = NULL,
axis.text = element_text(size = rel(0.8), colour = "grey30"),
axis.text = element_text(size = rel(0.8), colour = col_mix(ink, paper, 0.305)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume there is a numerical reason why you need the third digit in some but not all of these mix operations?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is just to land on the right hex code to preserve visual tests. I have no scruples to just take the prettier number here (like 0.3).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought so - let's just keep it as is to not mess with other packages visual tests

@teunbrand teunbrand merged commit 6d48584 into tidyverse:main Sep 13, 2024
13 checks passed
@teunbrand teunbrand deleted the theme_ink2 branch September 13, 2024 09:12
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