Github link=https://github.com/Belonit/AEColorPicker
安装
Windows:
将 AEColorPicker.aex 复制到文件夹
Adobe After Effects 安装目录\Support Files\Plug-ins
Mac: 将 AEColorPicker.plugin 复制到文件夹
Applications/Adobe After Effects [version]/Plug-ins
调用
var externalLibrary = new ExternalObject('lib:C:\\AEColorPicker.aex');
var oldColor = 0x20F186;
var newColor = externalLibrary.colorPicker(oldColor, dialog_title);
if(newColor == -1){ //Returns -1 if user clicked on cancel
newColor = oldColor;
}
或者你可以通过一些小技巧使用脚本完成
// https://community.adobe.com/t5/after-effects-discussions/calling-the-after-effects-color-picker-through-script/td-p/11954317
function ColorPicker(startValue) {
// find the active comp
var crntComp = app.project.activeItem;
if (!crntComp || !(crntComp instanceof CompItem)) {
alert('Please open a comp first');
return [];
}
// add a temp null;
var newNull = crntComp.layers.addNull();
var newColorControl = newNull('ADBE Effect Parade').addProperty('ADBE Color Control');
var theColorProp = newColorControl('ADBE Color Control-0001');
// set the value given by the function arguments
if (startValue && startValue.length == 3) {
theColorProp.setValue(startValue);
}
// prepare to execute
var editValueID = 2240; // or app.findMenuCommandId("Edit Value...");
theColorProp.selected = true;
app.executeCommand(editValueID);
// harvest the result
var result = theColorProp.value;
// remove the null
if (newNull) {
newNull.remove();
}
return result;
}
alert(ColorPicker([1, 1, 1]));