2017-04-26 81 views

回答

0

你想要的仅仅是HS色彩空间,其中V = 1(HSV),您可以生成后使用hsv2rgb的hsv

[xg,yg] = meshgrid(linspace(-1,1,1000)); 
% h is polar, s is radial 
[h,s] = cart2pol(xg,yg); 
% v is 1 inside the circle and 0 outside 
v = double(s <= 1); 
% normalize h to [0 1] 
h = h/(2*pi) + 0.5; 
% convert to rgb 
rgb = hsv2rgb(cat(3,h,s,v)); 
imshow(rgb) 

enter image description here

您可以进一步旋转h(添加常量和模体2*pi)来旋转圆圈。