Skip to contents

This function takes a vector of colors and returns the closest matching color from the MNB color palette.

Usage

closest_mnb_color(colors, limit = 300)

Arguments

colors

A character vector of color names or hexadecimal codes.

limit

Numeric. The maximum RGB distance allowed for a match. Default is 200.

Value

A character vector of the closest matching MNB colors or the original color if no match is found within the limit.

Examples

closest_mnb_color("red")
#> [1] "#da3232"
closest_mnb_color(c("blue", "green", "#FF00FF"))
#> [1] "#18223e" "black"   "white"