Cody

# Problem 42612. Convert ColorSpec string to RGB triplet

Solution 734424

Submitted on 13 Sep 2015 by LY Cao
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
%% assert(isequal(str2rgb('y'),[1 1 0]))

[Warning: Inputs must be character arrays or cell arrays of strings.]

2   Pass
%% assert(isequal(str2rgb('m'),[1 0 1]))

[Warning: Inputs must be character arrays or cell arrays of strings.]

3   Pass
%% assert(isequal(str2rgb('c'),[0 1 1]))

[Warning: Inputs must be character arrays or cell arrays of strings.]

4   Pass
%% assert(isequal(str2rgb('r'),[1 0 0]))

[Warning: Inputs must be character arrays or cell arrays of strings.]

5   Pass
%% assert(isequal(str2rgb('g'),[0 1 0]))

[Warning: Inputs must be character arrays or cell arrays of strings.]

6   Pass
%% assert(isequal(str2rgb('b'),[0 0 1]))

[Warning: Inputs must be character arrays or cell arrays of strings.]

7   Pass
%% assert(isequal(str2rgb('w'),[1 1 1]))

[Warning: Inputs must be character arrays or cell arrays of strings.]

8   Fail