Main Content
hex2rgb
Description
converts the specified hexadecimal color codes to RGB triplets. Specify
RGB
= hex2rgb(hexStr
)hexStr
as a string array or cell array of character vectors containing
the hexadecimal color codes. Each hexadecimal color code must start with a hash symbol
(#
) followed by three or six hexadecimal digits. The function returns
RGB
as an m-by-3 matrix or
m-by-n-by-3 array containing
double
values in the range [0, 1].
Examples
Input Arguments
Output Arguments
Version History
Introduced in R2024a