How can I convert a color name to a 3 element RGB vector?

后端 未结 4 1599
-上瘾入骨i
-上瘾入骨i 2021-01-12 18:51

In many MATLAB plotting functions, you can specify the color as either a string or as a 3 element vector that directly lists the red, green, and blue values.

For ins

4条回答
  •  爱一瞬间的悲伤
    2021-01-12 19:46

    I don't think there is a function for this in matlab. I suggest you use Marcs function, or this one-liner.

    C = rem(floor((strfind('kbgcrmyw', C) - 1) * [0.25 0.5 1]), 2); 
    

提交回复
热议问题