How to get brighter colors in a colormap?

3 views (last 30 days)
Sim
Sim on 1 Feb 2021
Edited: Sim on 1 Feb 2021
Hi, I would like to change the three colors in the bluewhitered colormap, i.e. red, white and blue into fuchsia, silver and emerald green:
rgb('fuchsia','silver','emerald green')
To do so I should change the colors in the bluewhitered function:
bottom = [0 0 0.5]; % blue
botmiddle = [0 0.5 1];
middle = [1 1 1]; % white
topmiddle = [1 0 0];
top = [0.5 0 0]; % red
into:
bottom = [0.929411764705882 0.0509803921568627 0.850980392156863]; % fuchsia
botmiddle = ?
middle = [0.772549019607843 0.788235294117647 0.780392156862745]; % silver
topmiddle = ?
top = [0.00784313725490196 0.56078431372549 0.117647058823529]; % emerald green
but how can I change the brighter ones?, i.e.:
botmiddle = ?
topmiddle = ?
  1 Comment
Sim
Sim on 1 Feb 2021
Thanks a lot to @Walter Roberson! But - just by curiosity - in case anyone could also give me the values for
botmiddle = ?
topmiddle = ?
I would be grateful :)

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 1 Feb 2021
  1 Comment
Sim
Sim on 1 Feb 2021
Thanks a lot, Custom Colormap looks working for my case:
mycolormap = customcolormap([0 0.5 1], rgb('fuchsia','silver','emerald green'));
colormap(mycolormap)
colorbar
Note: It looks working also with quantities - that you want to show with the colormap - which have both positive and negative values, and still using a positive range
[0 0.5 1]
in the command
customcolormap([0 0.5 1], ...

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!