MATLAB Answers

Colormap, how to get the color of the sea

조회 수: 24(최근 30일)
Xin
Xin 1 Dec 2016
답변: Image Analyst 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

채택된 답변

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개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by