www.pudn.com > Closid30.rar > Clflpclr.m, change:1997-06-06,size:724b


function [colorout] = clflpclr(colorin); 
% [colorout] = clflpclr(colorin) 
% 
% Will perform a color flip of the color specified in colorin. 
% In this way text can be displayed properly using the color 
% colorout on a coloured back ground, having color colorin. 
 
% 01-06-1996 (originally named flp_clr) 
% (c) Raymond de Callafon, Paul Van den Hof 
% Mechanical Engineering Systems and Control Group 
% Delft University of Technology 
% Last update: 05-06-1997. 
 
[n1,n2]=size(colorin); 
if ((n1~=1)|(n2~=3)) 
    error('input variable must be a 1 times 3 RBG value'); 
end 
colorout=1-colorin; 
diff=abs(colorout-colorin); 
index=find(diff<0.2); 
if ~isempty(index), 
    colorout(index)=ones(1,length(index)); 
end