Skip to content

Instantly share code, notes, and snippets.

@kumo
Created October 3, 2015 13:00
Show Gist options
  • Save kumo/c678b50de50b29a6e11d to your computer and use it in GitHub Desktop.
Save kumo/c678b50de50b29a6e11d to your computer and use it in GitHub Desktop.
Playing with Sketch colours and plugins
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