Skip to contents

Converts a column of RGB values to a HEX code Based on: https://stackoverflow.com/a/66810164

Usage

rgb2col(mat, col)

Arguments

mat

matrix of RGB color codes

col

index of column containing RGB values; row order is red, green, blue

Value

character vector of the HEX code

Examples

rgb2col(grDevices::col2rgb(c("#000C1C")))
#> [1] "#000C1C"