samer@47: function setcolours(bg,fg,root) samer@47: % setuicolours - set default foreground and background colours for UI elements samer@47: % samer@47: % setuicolours :: colour ~'background', colour ~'foreground' -> action. samer@47: % setuicolours :: colour ~'background', colour ~'foreground', handle ~'root' -> action. samer@47: % samer@47: % colour ::= [[1,3]] | {'k','r','g','b','c','m','y','w'}. samer@47: % samer@47: % The 3-argument form takes the handle of the object to which properties will be attached. samer@47: samer@47: if nargin<3, root=0; end samer@47: samer@47: classes1={'Control','Panel'}; samer@47: classes2={'Container','FlowContainer','GridContainer'}; samer@47: samer@47: set(root,'DefaultFigureColor',bg); samer@47: foreach(@(c)set(root,dc(c,'Foreground'),fg,dc(c,'Background'),bg),classes1); samer@47: foreach(@(c)set(root,dc(c,'Background'),bg),classes2); samer@47: set(root,dc('Menu','Foreground'),fg); samer@47: set(root,dc('Panel','Shadow'),0.7*bg,dc('Panel','Highlight'),min(1.3*bg,1)); samer@47: samer@47: function p=dc(c,fb), p=['DefaultUI' c fb 'Color'];