Specify light blue for color

262 ビュー (過去 30 日間)
Benjamin Cowen
Benjamin Cowen 2017 年 8 月 16 日
回答済み: Image Analyst 2017 年 8 月 16 日
Hi how can I specify the color light blue instead of green below?
patch([x3 fliplr(x4)], [y3 fliplr(y4)], 'g' 'EdgeColor','g') % Fill Area Between Radius Limits
hold on

回答 (2 件)

Chad Greene
Chad Greene 2017 年 8 月 16 日
編集済み: Chad Greene 2017 年 8 月 16 日
Hi Benjamin,
I'd do something like
h = patch([x3 fliplr(x4)], [y3 fliplr(y4)], 'g' 'EdgeColor','g');
set(h,'facecolor',[ 0.5843 0.8157 0.9882])
I got the RGB values of light blue from my rgb function by
rgb('light blue')
ans =
0.5843 0.8157 0.9882

Image Analyst
Image Analyst 2017 年 8 月 16 日
Define your colors as 1-by-3 arrays in the range 0-1. For example to have a light blue interior and a purple edge line, do this:
x = [1,4,4,1,1];
y = [2,2,1,1,2];
% Define light blue as whatever values you want
% but in the range of 0-255 and be sure to divide by 255 to get into the range 0-1.
lightBlue = [91, 207, 244] / 255;
purple = [103, 2, 94] / 255;
patch(x, y, lightBlue, ...
'EdgeColor', purple, ...
'LineWidth', 5)

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by