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 Oct. 28, 2024, 6:30 a.m.