# Create a temporary brand.yml file in a tempdir for this example
tmpdir <- withr::local_tempdir("brand")
path_brand <- file.path(tmpdir, "my-brand.yml")
yaml::write_yaml(
list(color = list(primary = "#abc123")),
path_brand
)
with_brand_yml_path(path_brand, {
brand <- read_brand_yml()
brand$color$primary
})
Run the code above in your browser using DataLab