Create a text file with following content.
var oNodes = designer.filterNodeTree(xfa.template, "value", "255,0,0");
for (var i = 0; i < oNodes.length; i += 1) {
oNodes.item(i).value = "0,0,0";
}
Save that file as .js file (i.e. my Macro.js).
Create a new folder under the macro folder of you LiveCycle or AEM Forms Designer (i.e. C:\Program Files (x86)\Adobe\Adobe Experience Manager Forms Designer\EN\Macros\MyMacros) and paste you .js file there.
Open your form in Designer an execute your new macro from [Tools] > [Macros].