Last active
November 17, 2023 22:26
-
-
Save GoodBoyNinja/9cd4c05e87b82c33586e4a31ed766eda to your computer and use it in GitHub Desktop.
filter color properties out of an array of properties.
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
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