get_brand_color_mix: Get a mix of brand colors

View source: R/get_brand.R

get_brand_color_mixR Documentation

Get a mix of brand colors

Description

[Maturing]

get_brand_color_mix() mixes two specific brand colors.

Usage

get_brand_color_mix(
  position = 500,
  color_1 = "primary",
  color_2 = "secondary",
  alpha = 0.5
)

Arguments

position

(Optional) A numeric vector indicating the position of the brand color in the range of tints. The range of positions is from 0 to 1000 (Default: 500).

color_1, color_2

(Optional) A character string indicating the name of a color present in the color section of the ⁠_brand.yml⁠ file (Default: primary, secondary).

alpha

(Optional) A number between 0 and 1 indicating the alpha (transparency) of the color mix (Default: 0.5).

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(), get_brand_color_tint(), get_brand_font()

Examples

get_brand_color_mix(
  position = 500,
  color_1 = "primary",
  color_2 = "secondary",
  alpha = 0.5
)
#> [1] "#8A2C50" # Expected

get_brand_color_mix(
  position = c(250, 500, 750),
  color_1 = "primary",
  color_2 = "secondary",
  alpha = 0.25
)
#> [1] "#591E23" "#B23D46" "#D89EA2" # Expected

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