desaturate: Perform simple desaturation or grayscale conversion of RGBA...

Description Usage Arguments Value Note References See Also

View source: R/vis_surface_background.R

Description

Perform simple desaturation or grayscale conversion of RGBA colors.

Usage

1
desaturate(color, gamma_correct = FALSE)

Arguments

color

rgba color strings

gamma_correct

logical, whether to apply non-linear gamma correction. First performs gamma expansion, then applies the gray-scale channel weigths, then gamma compression.

Value

rgba color strings, the grayscale colors. The information from one of the three rgb channels would be enough. The alpha value is not touched.

Note

Assumes sRGB color space.

References

see https://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale

See Also

Other color functions: alphablend()


fsbrain documentation built on Sept. 16, 2021, 5:07 p.m.