Hi,
depending on your version of InDesign you could use perhaps:
app.colorTransform()
document.colorTransform()
https://www.indesignjs.de/extendscriptAPI/indesign13/#Document.html#d1e49256__d1e52607
I did not do much with it, because providing numbers to the function is a bit strange.
What also can be done:
Add a new named color to the app or the document. Provide colorValue, model, name and space.
Then assign a new space. The color should be converted to the new space.
var doc = app.documents[0];
var newColor = doc.colors.itemByName("newColor");
if(newColor.isValid){ newColor.remove() };
if(!newColor.isValid)
{
doc.colors.add
(
{
name : "newColor" ,
colorValue : [0,0,0,100] ,
space : ColorSpace.CMYK
}
)
};
// Assign new space and color will be converted:
newColor.space = ColorSpace.RGB;
alert( newColor.colorValue );
Test for correct conversions of various color management settings.
This should do it…
Instead of document you could also add colors to the application as well with app.colors.add() instead of app.documents[0].colors.add().
Named colors will be added to the Swatches panel.
Regards,
Uwe