color

버전 1.2.0 (33.3 KB) 작성자: Yasin Zamani
Convert color name or hexadecimal color code to an RGB triplet.
다운로드 수: 213
업데이트 날짜: 2019/5/5

라이선스 보기

%% color
% Converts *color name* or *hexadecimal color code* to an *rgb* *triplet*.
%
% An *rgb* *triplet* is a three-element row vector whose elements specify
% the intensities of the red, green, and blue components of the color. The intensities
% are in the range [0,1]; for example, [0.4 0.6 0.7].
%
% A *hexadecimal color code* is a character vector or a string scalar that
% starts with a hash symbol (#) followed by three or six hexadecimal digits, which
% can range from 0 to F. The values are not case sensitive. Thus, the color codes
% '#FF8800', '#ff8800', '#F80', and '#f80' are equivalent.
%
%% Syntax
% |color|
%
% |rgb = color(name)|
%
% |rgb = color(hex)|
%
%% Description
% |color| shows color picker.
%
% |rgb = color(name)| converts color name to an rgb triplet.
%
% |rgb = color(hex)| converts hexadecimal color code to an rgb triplet.
%
%% Examples
%%
% figure('Color', color('ghost'));
% fplot(@(x) sin(x), 'Color', color('royal'), 'LineWidth', 7);
% hold('on');
% fplot(0, 'Color', color('fire'), 'LineWidth', 3, 'LineStyle', '--');
% hold('off');
% axis('off');
% title('Sin(x)', 'Color', color('golden'), 'FontSize', 20);
%
%% References
% <https://www.w3schools.com/colors/colors_names.asp https://www.w3schools.com/colors/colors_names.asp>
%
%% Author
% yasin.zamani@utah.edu
%

인용 양식

Yasin Zamani (2024). color (https://www.mathworks.com/matlabcentral/fileexchange/71273-color), MATLAB Central File Exchange. 검색됨 .

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

Community Treasure Hunt

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

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

Add `html` documentation.

1.1.0

Add `html` documentation.

1.0.0