getColorValue() throws error instead of returning 0 and setValue() on color parameters sets to black
I'm iterating through the properties of a component in Premiere Pro using ExtendScript. In order to detect whether a property is a color value, I'm calling getColorValue() as suggested in the documentation.
According to the documentation, this method is supposed to return 0 if the property is not a color. However, in practice, it throws an "Unknown error" exception when used on non-color properties.
This makes it difficult to safely check if a property holds a color value, and it contradicts the behavior described in the documentation.
I can successfully get the value of a color property using getValue(), which returns a numeric value. However, when I try to reuse that same value in setValue(value, 1) on a color parameter, the color always becomes black — regardless of the original value.
It seems like getValue() on a color parameter gives back some encoded internal number, but setting it via setValue() doesn’t restore the original color correctly.
Has anyone found a reliable way to:
-
Read a color value using getValue() (not getColorValue())
-
Reapply that same color to another property using setValue()
Or is the only option to use getColorValue() and setColorValue() instead?
