RGB.m

버전 1.2.0.0 (2.47 KB) 작성자: Phillip M. Feldman
RGB() converts a color index or name into an RGB triple with real-valued components in [0,1].
다운로드 수: 3.9K
업데이트 날짜: 2009/5/17

라이선스 보기

OVERVIEW

The Matlab function RGB() converts a color index (whole number from 1-21), English name of a color (string), or RGB triple with whole number components in {0, 1, ..., 255} into an RGB triple with real-valued components in [0,1]. RGB() allows the user to access a set of 21 colors via their common English names. For eight of these colors that have more than one common name, the program accepts alternative names, reducing the memory burden on the user.

INPUTS

- index_or_name can be a color index (whole number from 1-21), a string containing the name of a color in lower case, an RGB triple with elements in [0,1], or an RGB triple with elements in [0,255]. Note that some colors have more than one name, in which case any of these may be used. See the code for the list of color names.

OUTPUTS

- RGB is a length-3 vector of RGB components that can be used as a color specifier with any of the Matlab graphics functions.

If the input is an RGB triple with elements in [0,1], it is returned to
the calling program without modification.

If the input is an RGB triple with elements in [0,255], it is scaled by
1/255 and then returned.

If the input is a color index (1-21), it is converted to an RGB triple
via direct table lookup.

If the input is the name of a color, a search is done to find a matching name, and the corresponding RGB triple is returned.

인용 양식

Phillip M. Feldman (2024). RGB.m (https://www.mathworks.com/matlabcentral/fileexchange/24015-rgb-m), MATLAB Central File Exchange. 검색 날짜: .

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

도움 준 파일: Convert between RGB and Color Names

Community Treasure Hunt

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

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

Added information on dependencies.

1.1.0.0

Split out files in .zip as separate items.

1.0.0.0