get_brand_color: Get brand colors

View source: R/get_brand.R

get_brand_colorR Documentation

Get brand colors

Description

[Maturing]

get_brand_color() retrieves color codes from the ⁠_brand.yml⁠ file.

Usage

get_brand_color(color, alpha = NULL)

Arguments

color

A character vector indicating the name of colors present in the color section of the ⁠_brand.yml⁠ file.

alpha

(Optional) A number between 0 and 1, indicating the transparency of the colors (Default: NULL).

Details

Path to ⁠_brand.yml⁠

brandr will always look for a ⁠_brand.yml⁠ file in the root directory of your project. If the file is not found, an error message will be displayed. You can also set the path to the file manually using the options() function:

options(BRANDR_BRAND_YML = "PATH_TO_BRAND.YML")

Value

A character vector with hexadecimal color codes.

See Also

Other utility functions: get_brand_color_mix(), get_brand_color_tint(), get_brand_font()

Examples

get_brand_color("primary")
#> [1] "#DA4E3C" # Expected

get_brand_color("secondary")
#> [1] "#390963" # Expected

get_brand_color("tertiary")
#> [1] "#FB9706" # Expected

get_brand_color("tertiary", alpha = 0.5)
#> [1] "#FB970680" # Expected

get_brand_color(c("primary", "secondary"))
#> [1] "#DA4E3C" "#390963" # Expected

get_brand_color(c("red", "purple", "orange"))
#> [1] "#DA4E3C" "#390963" "#F06F20" # Expected

brandr documentation built on April 4, 2025, 5:30 a.m.