Resolves 'auto'
values based on the current execution environment
and configuration (i.e., auto_config_get()
).
auto_resolve_theme(theme)
a thematic_theme()
object.
The theme
object with resolved 'auto'
values.
old_config <- auto_config_set(auto_config(bg = "black", fg = "white"))
# Resolving auto values in local theme objects
theme <- thematic_theme()
theme[c("bg", "fg")]
#> $bg
#> [1] "auto"
#> attr(,"class")
#> [1] "thematic_auto"
#>
#> $fg
#> [1] "auto"
#> attr(,"class")
#> [1] "thematic_auto"
#>
theme <- auto_resolve_theme(theme)
theme[c("bg", "fg")]
#> $bg
#> [1] "black"
#> attr(,"class")
#> [1] "thematic_auto"
#>
#> $fg
#> [1] "white"
#> attr(,"class")
#> [1] "thematic_auto"
#>
# By default, auto values are resolved when accessing
# global theme options
thematic_on()
thematic_get_option("bg", resolve = FALSE)
#> [1] "auto"
#> attr(,"class")
#> [1] "thematic_auto"
thematic_get_option("bg")
#> [1] "black"
#> attr(,"class")
#> [1] "thematic_auto"
thematic_off()
auto_config_set(old_config)