Given a color object, this function writes a file containing the hexadecimal representation of the colors in the object.

writehex(x, file = "")

Arguments

x

a color object.

file

the name of the file to be written.

Value

The name of the file is returned as the value of the function.

Details

This function converts the given color object to RGB and then writes hexadecimal strings (of the form #RRGGBB) representing the colors to the specified file.

Author

Ross Ihaka

Examples

set.seed(1)
x <- sRGB(runif(10), runif(10), runif(10))
## IGNORE_RDIFF_BEGIN
writehex(x, file.path(tempdir(), "random.txt"))
#> [1] "/tmp/RtmpIJcr3M/random.txt"
## IGNORE_RDIFF_END