Get the intensity and/or luminance of a color

intensity(color)

luminance(color)

Arguments

color

A vector of colors

Value

A vector of intensities/luminances for each color

See also

Other color_theory: blend_colors(), col2hex(), text_color()

Examples

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