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

SDK: Parameter for LrColor with name and alpha value

Participant ,
Oct 04, 2022 Oct 04, 2022

Copy link to clipboard

Copied

#SDK - According to the API Reference, LrView static_text fields can have a "text_color" parameter that accepts a LrColor object to control the color of the text.

 

When looking at the LrColor definition, it can take various forms, including :

 

LrColor( name, a) ‌‌ Creates a color with the given name and alpha value.

 

So I tried:

 

text_color = LrColor("blue", 0.5) -- doesn't work

-- gives error "Invalid parameters for constructing an AgColor." when reloading the plugin

 

and I got an error saying : Invalid parameters for constructing an AgColor.

 

However, this works:

 

text_color = LrColor("blue") -- works

text_color = LrColor(.1, .2, .5) -- works

 

So what's wrong with the LrColor( name, a ) format? Am I using it incorrectly?

 

Thanks.

TOPICS
SDK

Views

34

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
LEGEND ,
Oct 04, 2022 Oct 04, 2022

Copy link to clipboard

Copied

LATEST

I noticed that a while ago -- who knows if it's a documentation bug or an implementation bug.  You could file a bug report:

https://community.adobe.com/t5/lightroom-classic-bugs/how-do-i-write-a-bug-report/idi-p/12386373

 

Adobe has been pretty responsive about fixing SDK documentation bugs (less so with implementation bugs, though they have fixed a number in the last couple of years).  

 

Meanwhile, as a workaround, instead of LrColor ("blue", 0.5), use LrColor (0, 0, 1, 0.5).

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