dockable UI - change colors??

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
pecollinni
Posts: 6
Joined: November 3rd, 2013, 4:00 pm

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
boldinger
Posts: 1
Joined: May 29th, 2012, 2:01 am

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
Post Reply