Skip to content

Instantly share code, notes, and snippets.

@GoodBoyNinja
Last active June 9, 2021 12:07
Embed
What would you like to do?
filter color properties out of an array of properties.
function FilterColorProperties(propsArray) {
var result = [];
//getting selected colors...
var propsArray =
propsArray == undefined ? (app.project.activeItem.selectedProperties || []) : propsArray;
if (!propsArray || !propsArray.length) {
// no selected colors because no properties are selected
return result;
}
for (var i = 0; i < propsArray.length; i++) {
var crntProp = propsArray[i];
if (crntProp.propertyValueType == PropertyValueType.COLOR) {
result.push(crntProp);
}
}
return result;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment