rgb.to.hex converts the first three values in rgb to a six
digit hexadecimal string preceded by a hash character. If all three values
are between 0 and 1, all are scaled up to a range of 0-255 unless
scale.up is FALSE.
Usage
rgb.to.hex(rgb,scale.up=TRUE)
Arguments
rgb
A numeric vector of length at least 3 representing the relative
red, green and blue values. Each value must be between 0 and 255.
scale.up
A logical value indicating whether to scale up when all
values are between 0 and 1.