Skip to contents

This function converts an RGB value to the hexadecimal numbering system.

Usage

rgb_to_hex(R, G, B, pound = TRUE)

Arguments

R

A int that is between 0 and 255 for the Red value.

G

A int that is between 0 and 255 for the Green value.

B

A int that is between 0 and 255 for the Blue value.

pound

A bool that indicates whether a pound sign should be prepended to the hexadecimal.

Value

A string containing the hexadecimal information.

Examples

# Hexadecimal with pound sign
rgb_to_hex(255,255,255)
#> [1] "#000000"

# Heaxadecimal without pound sign
rgb_to_hex(255,255,255,FALSE)
#> [1] "000000"