col2grayscale | R Documentation |
Convert a color to grayscale
col2grayscale(x, what = c("color", "decimal"))
x |
Color to convert to grayscale |
what |
Character: "color" returns a hexadecimal color, "decimal" returns a decimal between 0 and 1 |
Uses the NTSC grayscale conversion: 0.299 * R + 0.587 * G + 0.114 * B
col2grayscale("red")
col2grayscale("red", "dec")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.