str2rgb

バージョン 1.0.0.0 (1.72 KB) 作成者: Kenneth Eaton
Converts a string representation of a color to an RGB triple
ダウンロード: 1.6K
更新 2008/4/3

ライセンスの表示

A simple utility to convert a ColorSpec value, represented as a string, to a numeric RGB triple. This function does not use eval. One possible use is for reading a user-entered color value from an editable text box.

Examples:
str2rgb('yellow') returns [1 1 0]
str2rgb('y') returns [1 1 0]
str2rgb('[1 1 0]') returns [1 1 0]
str2rgb('1 1 0') returns [1 1 0]
str2rgb('[1; 1; 0]') returns [1 1 0]
str2rgb('[0 0.5 0.91]') returns [0 0.5000 0.9100]
str2rgb('purple') returns NaN
str2rgb('[1 2]') returns NaN

引用

Kenneth Eaton (2026). str2rgb (https://jp.mathworks.com/matlabcentral/fileexchange/19432-str2rgb), MATLAB Central File Exchange. に取得済み.

MATLAB リリースの互換性
作成: R14SP3
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersCharacters and Strings についてさらに検索
謝辞

ヒントを与えたファイル: Convert between RGB and Color Names, GETRGB (v1.0)

バージョン 公開済み リリース ノート
1.0.0.0