View source: R/visualization.R
BGTextColor | R Documentation |
Determine text color based on background color
BGTextColor(
background,
threshold = 186,
w3c = FALSE,
dark = "black",
light = "white"
)
background |
A vector of background colors; supports R color names and hexadecimal codes |
threshold |
Intensity threshold for light/dark cutoff; intensities
greater than |
w3c |
Use W3C formula for calculating
background text color; ignores |
dark |
Color for dark text |
light |
Color for light text |
A named vector of either dark
or light
, depending on
background
; names of vector are background
BGTextColor(background = c('black', 'white', '#E76BF3'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.