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

getColorValue() throws error instead of returning 0 and setValue() on color parameters sets to black

Community Beginner ,
May 22, 2025 May 22, 2025

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:

  1. Read a color value using getValue() (not getColorValue())

  2. Reapply that same color to another property using setValue()

Or is the only option to use getColorValue() and setColorValue() instead?

TOPICS
Error or problem
76
Translate
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
no replies

Have something to add?

Join the conversation