view graphics/colour/rgbmap.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
parents 82075c94eed1
children
line wrap: on
line source
function clut=rgbmap(r,g,b)

% rgbmap(r,g,b)
% returns rgb colour map of size r*g*b
R=[1 0 0]/(r-1);
G=[0 1 0]/(g-1);
B=[0 0 1]/(b-1);

clut=zeros(r*g*b,3);
for i=0:r-1
	for j=0:g-1
		for k=0:b-1
			clut(1+k+(j+i*g)*b,:)=k*B+j*G+i*R;
		end
	end
end