Last active
June 16, 2020 01:12
-
-
Save janily/c5595f6067028fb4a4d6517379877608 to your computer and use it in GitHub Desktop.
get selection style
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let sketch = require('sketch') | |
| let doc = sketch.getSelectedDocument() | |
| let selection = doc.selectedLayers.layers[0] //basic rect layer | |
| let randomRadius = Math.round((Math.random()*100)) | |
| console.log("randomRadius: " + randomRadius) | |
| selection.points.forEach(point => point.cornerRadius = randomRadius) | |
| selection.sketchObject.setFixedRadius(randomRadius) | |
| console.log(selection.sketchObject.CSSAttributes())let sketch = require('sketch') | |
| let doc = sketch.getSelectedDocument() | |
| let selection = doc.selectedLayers.layers[0] //basic rect layer | |
| let randomRadius = Math.round((Math.random()*100)) | |
| console.log("randomRadius: " + randomRadius) | |
| selection.points.forEach(point => point.cornerRadius = randomRadius) | |
| selection.sketchObject.setFixedRadius(randomRadius) | |
| console.log(selection.sketchObject.CSSAttributes()) | |
| let sketch = require('sketch') | |
| let doc = sketch.getSelectedDocument() | |
| let selection = doc.selectedLayers.layers[0] | |
| console.log(selection.type) | |
| // 'SymbolInstance' | |
| console.log(selection.style.fills) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment