MATLAB Answers

Colormap, how to get the color of the sea

조회 수: 13(최근 30일)
Xin
Xin 1 Dec 2016
This is an interesting question to me. I wanted to create a nice colormap with very smooth and gradual transition from white to sea blue. I tried to do it manually in colormap but it does not work out very well. Anybody who has explored this, or know some developed colormap?
Many thanks

  댓글 수: 0

로그인 to comment.

채택된 답변

Image Analyst
Image Analyst 1 Dec 2016
Try a program where you can easily get the RGB values of some color of blue that you like, like (r,g,b) = (rBlue, gBlue, bBlue). Then use linspace().
numColors = 256; % Good value for 24/32 bit displays.
oceanRed = 15;
oceanGreen = 127;
oceanBlue = 230;
myColorMap = [linspace(oceanRed, 255, numColors)'/255,...
linspace(oceanGreen, 255, numColors)'/255,...
linspace(oceanBlue, 255, numColors)'/255]
imshow('cameraman.tif');
colormap(gca, myColorMap);
colorbar

  댓글 수: 0

로그인 to comment.

More Answers (0)

이 질문에 답변하려면 로그인을(를) 수행하십시오.

태그


Translated by