Learn R Programming

fsbrain (version 0.7.0)

hex_to_rgba: Convert hex color string to RGBA float vector

Description

Converts a hex color string like "#FF0000" or "#FF0000FF" to a length-4 RGBA numeric vector with values in the range 0..1.

Usage

hex_to_rgba(hex)

Value

numeric vector of length 4, RGBA values in 0..1 range.

Arguments

hex

character string, a hex color code with 6 or 8 digits.