Doron’s great post earlier this week on fancy color gradients has left us with an open fundamental question – how to choose color combinations? While there’s no explicit answer to this, I was reminded of some awesome relevant online tools that, frankly, I should use more often. Since we’re all into figurework this week, here are a few picks, each with its distinct approach.
Perhaps the most intuitive source of inspiration is an image with a color composition that you really like. Palette Generator will build a palette from any such image that you upload.

COLOURlovers is a community-based site with countless palettes uploaded (and voted) by users, for those who choose to follow the aesthetics of the crowd.
Coolors is a color roulette. You never know what you’re gonna get. Just press the spacebar multiple times until you hit something you like, then adjust it a bit to your taste.
Adobe has an interactive palette picker, where every action affects all colors in your palette, until tuning is complete. You may also use it to employ a few color theory rules of thumb.
Hadas once sent me a link to a matlab function that returns RGB values for “intuitive” color names in natural language (based on a thorough xkcd survey of the spectrum). Envious Python users should check out seaborn.
Finally, most of the above sources provide HTML colors (in hex format, such as #06D7FF). Nevertheless, they can be easily converted to matlab RGB colors, for example using a function such as:
function cmap = hex2rgb(varargin)
n = length(varargin);
cmap = zeros(n, 3);
for i = 1:n
assert(ischar(varargin{i}) && (varargin{i}(1) == '#') && (length(varargin{i}) == 7) && all(ismember(varargin{i}(2:end), '0123456789aAbBcCdDeEfF')), 'expecting hex/html color format: #RRGGBB')
cmap(i, 1) = hex2dec(varargin{i}(2:3))/255;
cmap(i, 2) = hex2dec(varargin{i}(4:5))/255;
cmap(i, 3) = hex2dec(varargin{i}(6:7))/255;
end
Here it is at work, to set discrete colors for your plots:
>> colormap(hex2rgb('#773300', '#bb5533', '#eeaa99'))
And as basis for fancy gradients:
>> colormap(colormapCreator(num2cell(hex2rgb('#773300', '#bb5533', '#eeaa99'), 2), [0.5, 0.5], 10))
You must be logged in to post a comment.