HEX2RGB

버전 1.0.0.0 (2.48 KB) 작성자: Jos (10584)
Convert hexadecimal color strings to RGB values (v1.0, feb 2014)
다운로드 수: 1.3K
업데이트 날짜: 2014/3/3

라이선스 보기

RGB = HEX2RGB(HEX) converts the hexadimal color string HEX to its corresponding RGB values. RGB has three columns representing the red, green and blue component of the colour.
For a cell array of color strings, RGB will have as many rows as elements of the cell array. For a character array HEX, RGB will have as many rows as HEX.

Three-digit hexadecimal color strings are expanded to six-digit strings by doubling each digit (i.e., XYZ -> XXYYZZ).

Examples:
hex2rgb('556b2f') % 6 digit string
% -> [ 85 107 47]
hex2rgb('f0f') % 3 digit string
% -> [255 0 255]
hex2rgb({'8B4513','FF0'}) % cell array
% -> [139 69 19 ; 255 255 0]
hex2rgb(['FF6347' ; '40E0D0']) % character array with multiple rows
% -> [255 99 71 ; 64 224 208]

Hexadecimal color strings are three-byte triplets representing the red, green and blue component. One byte represents a number in the range 00 to FF (in hexadecimal notation).
More information:
http://en.wikipedia.org/wiki/Web_colors

인용 양식

Jos (10584) (2024). HEX2RGB (https://www.mathworks.com/matlabcentral/fileexchange/45727-hex2rgb), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2011b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Numeric Types에 대해 자세히 알아보기
도움

받음: hextorgb

줌: rgb2hex and hex2rgb

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0