Skip to content

Instantly share code, notes, and snippets.

@GoodBoyNinja
Last active November 17, 2023 22:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GoodBoyNinja/9cd4c05e87b82c33586e4a31ed766eda to your computer and use it in GitHub Desktop.
Save GoodBoyNinja/9cd4c05e87b82c33586e4a31ed766eda to your computer and use it in GitHub Desktop.
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