Skip to content

Instantly share code, notes, and snippets.

@getflourish
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save getflourish/1bdcb4a596a140fc97cf to your computer and use it in GitHub Desktop.
Save getflourish/1bdcb4a596a140fc97cf to your computer and use it in GitHub Desktop.
getColorOf: function(layer) {
var color = null;
var fill = null;
if ([layer isKindOfClass:[MSTextLayer class]]) {
color = [layer textColor];
}
try {
fill = [[[layer style] fills] firstObject];
if (fill !== null && [fill isEnabled] && [fill fillType] === 0) color = [fill color];
} catch (error) {
}
return color;
},
isIncluded: function(arr, obj) {
return (arr.indexOf(obj) != -1);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment