Is there a way to color rasterItems with a spot color via scripting?
I would like to color a grayscale raster image via scripting. Since it's not possible to simply reference via fillColor, I have to use colorize(). The problem with colorize however is it doesn't seem to take Spot colors and only CMYK and RGB swatches. With the following I can get it to colorize my grayscale image, but since it's CMYK and not a spot, the raster fill color shows blue but the object itself appears black. Is there away that I can apply a fill via scripting? Could I group it, apply a fill and expand the appearance? It appears adding a fill to a group and expanding in this manor will work if I can get it to script, and although I'd have to delete an added unfilled raster item, I'm looking for any viable workaround to color a raster image.
var aD = app.activeDocument;
var nC = new CMYKColor();
nC.cyan = 100;
nC.magenta = 0;
nC.yellow= 0;
nC.black = 0;
var nCo = aD.spots.add();
nCo.colorType = ColorModel.SPOT;
nCo.color = nC;
nCo.tint = 100;
var newSpotColor = new SpotColor();
newSpotColor.spot = nCo;
//aD.pageItems[0].filled = true;
aD.rasterItems[0].overprint = true;
aD.rasterItems[0].colorize(nCo.color); //Testing with color value, as newSpotColor doesn't seem accessible via colorize for a spot color
