View source: R/vis_surface_background.R
desaturate | R Documentation |
Perform simple desaturation or grayscale conversion of RGBA colors.
desaturate(color, gamma_correct = FALSE)
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. |
rgba color strings, the grayscale colors. The information from one of the three rgb channels would be enough. The alpha value is not touched.
Assumes sRGB color space.
see https://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale
Other color functions:
alphablend()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.