Copy link to clipboard
#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?
I noticed that a while ago -- who knows if it's a documentation bug or an implementation bug. You could file a bug report:
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).