1 заметка с тегом
Sketch
Пишем плагин Sketch
21 июня 2017, 4:32
var sketch = context.api() var doc = sketch.selectedDocument var page = doc.selectedPage var group = page.newGroup({frame: new sketch.Rectangle(0, 0, 200, 200), name: "test"}) var rect = group.newShape({frame: new sketch.Rectangle(50, 50, 100, 100), name: "cell1" })
var onRun = function(context) { var sketch = context.api() var doc = sketch.selectedDocument var page = doc.selectedPage var count = 5 var size = 320/count var group = page.newGroup({frame: new sketch.Rectangle(0, 0, 320, size), name: "test"}) var colors = ["#ff000090","#00FF00FF"] for(i = 0; i < count; i++){ var rect = group.newShape({frame: new sketch.Rectangle(i*size, 0, size, size), name: "cell1",fills: ["#00FF0090"], borders: ["#303030FF"] }) } };