Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Change color of layer styles???

  • Change color of layer styles???

    Posted by Shahrokh Jahanzadeh on August 16, 2013 at 4:42 am

    Hi there,
    I have a little problem here…
    Dan Ebberts answered a question about adding a layer style – like Bevel and Emboss -. it is really great script.
    But when I wanna change the Highlight Color it doesn`t work.
    Can anyone help me to fix it?

    – the problem is in the last line…

    {
    var myCompName = "Comp 1";

    var myComp = null;
    for (var i = 1; i <= app.project.numItems; i++){
    if (app.project.item(i).name == myCompName && app.project.item(i) instanceof CompItem){
    myComp = app.project.item(i);
    }
    }
    if (myComp){
    myComp.openInViewer();
    myComp.layer(1).selected = true;
    app.executeCommand(app.findMenuCommandId("Bevel and Emboss"));
    }
    var layer = app.project.activeItem.layer(1);
    layer.property("Layer Styles").property("Bevel and Emboss")("Depth").setValue(1000);
    layer.property("Layer Styles").property("Bevel and Emboss")("Size").setValue(4);
    layer.property("Layer Styles").property("Bevel and Emboss")("Highlight Mode").setValue(16);
    layer.property("Layer Styles").property("Bevel and Emboss")("Highlight Color").setValue[(128,0,128)];

    }

    Shahrokh Jahanzadeh replied 13 years, 1 month ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    August 16, 2013 at 6:33 am

    Try this:

    layer.property(“Layer Styles”).property(“Bevel and Emboss”)(“Highlight Color”).setValue([.5,0,.5,1]);

    Color values need to be between zero and one.

    Dan

  • Shahrokh Jahanzadeh

    August 16, 2013 at 8:15 am

    Thank you very mush Dan…
    That`s work perfectly…

    Shahrokh

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy