Color alpha method always returns 255

I’m using the Ruby API in SketchUp Pro 2020. When calling the alpha method for Color the result is always 255, even if opacity is set to transparent in the material properties.

Here the example command:
Sketchup.active_model.materials[“Material”].color.alpha

Is it a bug or I’m not using it correctly?

I think the transparency is set in the material itself.

So Sketchup.active_model.materials[“Material”].alpha should give you the value (between 0 and 1)

The latter. Although the docs don’t state it, Color object alpha transparency is for use with Color by Layer / Tag style only.

Thanks to both of you. Solved and understood :smile:

1 Like