• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

I got some problem about AE JavaScript;

Community Beginner ,
May 08, 2017 May 08, 2017

Copy link to clipboard

Copied

Hi everyone, I'm new to AE js, and I wonder How do I get the color value/ or set value of fill color for the text layer.

I tried so many times but failed...

thanks

Views

572

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 08, 2017 May 08, 2017

Copy link to clipboard

Copied

You should check out the expression language section of the help menu. Colors are determined with an array with four vapes. The value range is from 0 to 1 with as many decimal points as you like. The values describe the Red, Green, Blue and Alpha channel value for a color. For example adding this to an expression for fill color gives you 50% gray: [.5, .5, .5, 1] 

You can find the color values for elements in your comp panel by observing the info panel. Set the display to decimal:

Screen Shot 2017-05-08 at 9.23.46 PM.png

Then sample a color and you'll get the values to type in the array:

Screen Shot 2017-05-08 at 9.23.35 PM.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 08, 2017 May 08, 2017

Copy link to clipboard

Copied

Thanks for your answer sincerely, I want to get that RGBA value into a JavaScript array automatically,,,so I need a JavaScript expression to get that RGBA value. like var aColorValue = **********,,,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 08, 2017 May 08, 2017

Copy link to clipboard

Copied

You need to explain exactly what you are trying to do. You can drive color that can be animated with an expression. I don't understand what you want to accomplish or where you are going with javascript. After Effects and After Effects Scripting are related to javascript but are separate and distinct. After Effects is used to create video and that's all. Please explain in detail what you are trying to do.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 19, 2017 Jul 19, 2017

Copy link to clipboard

Copied

Hi Xia.Zhao,

Did Rick's info help you solve this issue? Please let us know. Provide more details for further assistance.

Thanks,
Kevin

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 19, 2017 Jul 19, 2017

Copy link to clipboard

Copied

Hi Kevin,

thank you,,Rick's info helps me too..and I think I got the way to solve my problem,,

and I will explain more clearly and more exactly next time.

Sincerely

Xia.zhao

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 20, 2017 Jul 20, 2017

Copy link to clipboard

Copied

Hey Xia.zhao,

Good to hear from you! How do you plan to solve the issue? What's your idea? Let us know so we can assist, if possible.

Thanks!
Kevin

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 23, 2017 Jul 23, 2017

Copy link to clipboard

Copied

LATEST

Hi Kevin,

maybe this is the answer I want that time;

var layer = app.project.activeItem.layer(1);                                        //get an textLayer

var textLayerDocument = layer.property("Source Text").value;                        //get fill color value

textLayerDocument.fillColor = [0.5, 0.5, 0.5];                                      //stort fill color value to [0.5, 0.5, 0.5] for textDocument object

layer.property("Source Text").setValue(textLayerDocument);                          //set textDocument value for textLayer "Source Text" property;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines