Created
October 3, 2015 13:00
-
-
Save kumo/c678b50de50b29a6e11d to your computer and use it in GitHub Desktop.
Playing with Sketch colours and plugins
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
var doc = context.document | |
var selectionCount = context.selection.count() | |
if (selectionCount == 0) { | |
doc.showMessage("Nothing selected.") | |
return | |
} | |
var tile = context.selection[0] | |
var style = [tile style] | |
var fills = [style fills] | |
var newColour = MSColor.colorWithSVGString("#aaffcc") | |
var fills_array = [fills array] | |
for(var i=0; i < [fills_array length]; i++){ | |
var fill = fills_array[i] | |
var fillType = [fill fillType] | |
if (fillType == 0) { | |
fill.color = newColour | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment