Determine text color based on background color
Arguments
- background
A vector of background colors; supports R color names and hexadecimal codes
- threshold
Intensity threshold for light/dark cutoff; intensities greater than
thesholdyielddark, others yieldlight- w3c
Use W3C formula for calculating background text color; ignores
threshold- dark
Color for dark text
- light
Color for light text
Value
A named vector of either dark or light, depending on
background; names of vector are background
Examples
BGTextColor(background = c('black', 'white', '#E76BF3'))