col2grayscale: Color to Grayscale

View source: R/colorOps.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

Examples

col2grayscale("red")
col2grayscale("red", "dec")


egenn/rtemis documentation built on Dec. 17, 2024, 6:16 p.m.