Matlab-颜色格式转换

HEX转化成RGB

function rgb = hex2rgb(hexString)
    r = double(hex2dec(hexString(2:3)))/255;
	g = double(hex2dec(hexString(4:5)))/255;
	b = double(hex2dec(hexString(6:7)))/255;
	rgb = [r, g, b];
end
% 调用
hex2rgb('#e5f5f9')

RGB转化成HEX

hex=dec2hex([229,245,249]);
hex=['#',hex(1,:),hex(2,:),hex(3,:)];

HSV转化成RGB

rgb = hsv2rgb(hsv);

RGB转化成HSV

hsv = rgb2hsv(rgb);

你可能感兴趣的:(Matlab,matlab)