best_contrast: Find highest contrast color

View source: R/contrast_ratio.R

best_contrastR Documentation

Find highest contrast color

Description

Finds the color in 'y' with the highest contrast to the color 'x'.

Usage

best_contrast(x, y = c("#010101", "#FFFFFF"))

Arguments

x

Multiple colors

y

Multiple colors

Value

The elements of 'y' with highest contrast to 'x'.

Examples

best_contrast("red")
best_contrast("grey20")
best_contrast("white")

best_contrast(rainbow(10), rainbow(3))

prismatic documentation built on May 29, 2024, 6:04 a.m.