It seems that for ComponentParams that use color values, the keyframes created via createKeyframedo not always hold the correct value. From what I can tell so far the blue channel gets scrambled in some way. Also the set functionality for those color keyframes does not accept Color objects, which makes changing existing keyframes hard.
The following function should reproduce the error on a trackitem with the Tint effect applied. In theory it should set the first parameter to white, but at least for me it results in a yellow color.
const ppro = require("premierepro");
async function testTint() {
const target = "AE.ADBE Tint";
const project = await ppro.Project.getActiveProject();
const sequence = await project.getActiveSequence();
const selected = await sequence.getSelection();
const tracks = await selected.getTrackItems();
const trackitem = tracks[0]; //currently first selected track. Should be the one holding the Tint effect
const getTint = async (matchTarget, trackItem) => {
const chain = await trackItem.getComponentChain();
for (let index = 0; index < chain.getComponentCount(); index++) {
const element = chain.getComponentAtIndex(index);
const compMatchname = await element.getMatchName();
if (compMatchname === matchTarget) {
return element;
}
}
};
const component = await getTint(target, trackitem);
const whiteColor = new ppro.Color(1, 1, 1, 1);
const newValue = component.getParam(0).createKeyframe(whiteColor);
console.log(newValue);
project.lockedAccess(() => {
project.executeTransaction((compAction) => { compAction.addAction(component.getParam(0).createSetValueAction(newValue));
}, "changeTintColor");
});
}