Page 1 of 1

dockable UI - change colors??

Posted: November 30th, 2013, 8:59 am
by pecollinni
hello,

is it possible to change the colors of buttons, progressbars etc. in dockable ui panel?

I found this on adobe forum, but I can't get it working for *panels* :?

Code: Select all


var win = new Window("palette", "New", undefined);     //Creates window
     var grp = win.add("group");
     var but = grp.add("button", undefined, "TEST");

var winGfx = win.graphics;
var black = winGfx.newPen(winGfx.BrushType.SOLID_COLOR, [0,0,0], 1);
var blue = winGfx.newBrush(winGfx.BrushType.SOLID_COLOR, [0,.75,1], 1);
var green = winGfx.newBrush(winGfx.BrushType.SOLID_COLOR, [0,1,0], 1);
var red = winGfx.newBrush(winGfx.BrushType.SOLID_COLOR, [1,0,0], 1);
var yellow = winGfx.newBrush(winGfx.BrushType.SOLID_COLOR, [1,1,0], 1);

grp.graphics.backgroundColor = green;     //Set group color

win.graphics.backgroundColor = red;     //Set window color


win.center();
win.show();

thanks

Re: dockable UI - change colors??

Posted: December 21st, 2013, 11:04 am
by boldinger
Hello,

It works the same, you will have to specify the panel thoe.


E X A M P L E :
myPanel.grp = myPanel.add(res);
var winGfx = myPanel.grp.graphics;
var white = winGfx.newBrush(winGfx.BrushType.SOLID_COLOR, [1,1,1], 1);
var black = winGfx.newBrush(winGfx.BrushType.SOLID_COLOR, [0,0,0], 1);

myPanel.grp.Panel1.graphics.backgroundColor = white; // Set Panel1 to white
myPanel.graphics.backgroundColor = black; // set Window to black


Hope it helps

Cheers