Last active
May 30, 2017 04:10
-
-
Save marianomike/b69a545043987059bf129ca76941c48c to your computer and use it in GitHub Desktop.
This file contains 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
for (var k = 0; k < sharedStyles.numberOfSharedStyles(); k++){ | |
var layerStyle = sharedStyles.objects().objectAtIndex(k); | |
var styleName = String(layerStyle.name()); | |
//checks if the name of the imported color is the same as the existing | |
if(styleName == colorName){ | |
var fill = layerStyle.value().fills().firstObject(); | |
var oldFill = String("#" + fill.color().immutableModelObject().hexValue()); | |
//checks if the existing color value is different than the imported one | |
if(oldFill != colorValue){ | |
//change the fill color of the shared style | |
fill.color = colorFromString(colorValue); | |
//create a color to be added to the Document colors | |
var color = colorFromString(colorValue); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment