File: findColorIndex.sci

package info (click to toggle)
scilab-plotlib 0.41-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,196 kB
  • sloc: xml: 3,308; makefile: 15
file content (22 lines) | stat: -rw-r--r-- 578 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function ind=findColorIndex(win,col)

c=win.user_data.FixedColors;
ind=find(and([c(:,1)==col(1) c(:,2)==col(2) c(:,3)==col(3)],'c'));
if ind==[]
   ind=find(isnan(c(:,1)));
   if ind==[] // basic colormap is full !
      N=size(c,1);
      ind=N+1;
      win.user_data.FixedColors(N+1:2*N,:)=%nan;
      if win.user_data.Colormaptable~=[]
        win.user_data.Colormaptable=[];
        activateRGBColormap(win);
        _update_shaded_plots(win),
      end
   end
   win.color_map(ind(1),:)=col(:)';
   win.user_data.FixedColors(ind(1),:)=col(:)';
end
ind=ind(1);

endfunction