
function varargout = typcols(varargin)

  global TC;
  

% get the root settings to return to later
rootsettings = [ ...
            {get(0,'Units')}, ...
				{get(0,'DefaultuicontrolUnits')}, ...
				{get(0,'DefaultuicontrolBackgroundColor')}, ...
				{get(0,'DefaulttextHorizontalAlignment')} ...
				];

%getscreen size and open the main interface window
set(0,'Units','centimeters');
SSz = get(0,'ScreenSize');


load typcols


szTC = 17; % a sqaire of 17 x 17 cm
hTC = figure('Color',[1 1 1]*.8, ...
				 'Name','Display Slices', 'NumberTitle','off',...
			    'MenuBar','none','Units','centimeters', ...	      
				 'Position',[SSz(3)*.07 (SSz(4)-15)/2 szTC szTC], ...
				 'RendererMode','manual', ...
				 'HandleVisibility','off',...
				 'Resize','off', 'Visible','on'...
				 );


% Set default 'Units' to 'centimeters' and 'BackgroundColor',gray
% ---------------------------------------------------------------
set(0,'DefaultuicontrolUnits','centimeters', ...
      'DefaultuicontrolBackgroundColor',[1 1 1]*.7, ...
      'DefaulttextHorizontalAlignment','center');


borlo = 0.05; borsh =0.03;

bsz =   [3 1]*.8;      % Default button size (fixed proportions 1 x 3)

F = [borsh, borlo*2+bsz(1), szTC-2*borsh, szTC-2*borlo-bsz(1)];

		
uicontrol('Parent',hTC,'Style','frame','Position',F);
uicontrol('Parent',hTC,'Style','pushbutton','Position',F);


X=1:30';
X=reshape(X,5,6)';

map = reshape([cols(:).rgb]',3,30)';
h=image(X); colormap(map)



% return to the original settings
set(0,'Units',rootsettings{1});
set(0,'DefaultuicontrolUnits',rootsettings{2});
set(0,'DefaultuicontrolBackgroundColor',rootsettings{3});
set(0,'DefaulttextHorizontalAlignment',rootsettings{4});




