
function [B] = colorer(A)

lut=colormap;

n_lut=size(lut);
n_lut=256/n_lut(1);
lutR=lut(:,1); lutG=lut(:,2); lutB=lut(:,3);

A=double(A);

[m,n]=size(A);
B=zeros(m,n,3);
indices=1+floor(A/n_lut);
B(:,:,1)=lutR(indices); B(:,:,2)=lutG(indices); B(:,:,3)=lutB(indices);
B=uint8(255*B);
