rgb2hex: Convert RGB to HEX Color

View source: R/utilities.R

rgb2hexR Documentation

Convert RGB to HEX Color

Description

Function to convert rgb color to hex color

Usage

rgb2hex(r = 0, g = 0, b = 0)

Arguments

r, g, b

colors, numeric scalar between 0 and 255

Author(s)

Nicholas Hamilton

Examples

#Black
rgb2hex(0,0,0)

#White
rgb2hex(255,255,255)

#Red
rgb2hex(255,0,0)

#Green
rgb2hex(0,255,0) 

#Blue
rgb2hex(0,0,255)

#Vectorised sequence of blue
rgb2hex(0,0,seq(0,255,by=5))

ggtern documentation built on June 22, 2024, 11:01 a.m.