col2grayscale: Color to Grayscale

View source: R/utils_color.R

col2grayscaleR Documentation

Color to Grayscale

Description

Convert a color to grayscale

Usage

col2grayscale(x, what = c("color", "decimal"))

Arguments

x

Color to convert to grayscale

what

Character: "color" returns a hexadecimal color, "decimal" returns a decimal between 0 and 1

Details

Uses the NTSC grayscale conversion: 0.299 * R + 0.587 * G + 0.114 * B

Value

Character: color hex code.

Author(s)

EDG

Examples

## Not run: 
col2grayscale("red")
col2grayscale("red", "dec")

## End(Not run)

egenn/rtemis documentation built on June 14, 2025, 11:54 p.m.