How to use the sketch-constructor.SharedStyle.LayerStyle function in sketch-constructor

To help you get started, we’ve selected a few sketch-constructor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github phodal / design / adapter / visual / sketch / index.js View on Github external
colors.forEach((color, i) => {
        let swatch = new Swatch(Object.assign({}, color, {
            frame: {
                x: 10,
                y: i * 220 + 20,
                width: 200,
                height: 60
            }
        }));
        let layerStyle = SharedStyle.LayerStyle({
            name: color.label,
            fills: [{
                color: color.value
            }]
        });
        sketch.addLayerStyle(layerStyle);
        artboard.addLayer(swatch);
    });
}

sketch-constructor

Read/write/manipulate Sketch files in Node without Sketch plugins!

Apache-2.0
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis