Transform a rgb vector to a Rcolor code

rgb2code(x, rev = FALSE)

Arguments

x

vector or three columns data.frame

rev

reverse,transform a Rcolor code to a rgb vector

Value

Rcolor code like "#69C404"

Examples

rgb2code(c(12, 23, 34))
#> [1] "#0C1722"
rgb2code("#69C404", rev = TRUE)
#>   r   g   b 
#> 105 196   4