sketch-hq/SketchAPI

APIs missing: Set Fills opacity

matteogratton opened this issue · 0 comments

It is currently impossible to set the general opacity for the fill. This is not noticeable for default color fills, as the general opacity and the color opacity are the same. For gradients and patterns, this is more uncomfortable.

This is the area I am referring to:
CleanShot 2022-06-23 at 11 48 27

The current way to set it is via:
layer.style.sketchObject.fills()[1].contextSettings().setOpacity(0.5);

It would be nice to have something like:
layer.style.fills[value].opacity = 0.5

It is also missing a way to read the option:
layer.style.sketchObject.fills()[1].contextSettings().opacity();