R/color_theory.R
contrast-theory.Rd
Get the intensity and/or luminance of a color
intensity(color) luminance(color)
https://stackoverflow.com/questions/3942878/how-to-decide-font-color-in-white-or-black-depending-on-background-color
A vector of colors
A vector of intensities/luminances for each color
Other color_theory: blend_colors(), col2hex(), text_color()
blend_colors()
col2hex()
text_color()
intensity(color = c('black', 'white', '#E76BF3')) #> black white #E76BF3 #> 0.00 255.00 159.58 luminance(color = c('black', 'white', '#E76BF3')) #> black white #E76BF3 #> 0.0000000 1.0000000 0.3397538