function paintChips(c1, c2, n)
% Draw n paintChips that interpolate colors c1 and c2.
% n is an integer > 1.  c1 and c2 are RGB vectors.

close all
figure
axis equal off
hold on

x= [0 3 3 0];  % x-values of tile
y= [0 0 1 1];  % y-values of first tile

for k= 0:n-1
   % Compute color of kth tile  
   f= k/(n-1);
   v= (1-f)*c1 + f*c2;
   % Draw kth tile
   fill(x, y+k, v)
   text(3.5, k+.5, ...
        sprintf('[%.1f  %.1f  %.1f]',...
                v(1),v(2),v(3)) )
end

hold off