[ExtendScript] RasterItem.colorize() does not accept SpotColor via script, but does via UI.
MacOS 13.3.1, Adobe Illustrator 27.4.1
The colorize() method of RasterItem doesn't accept a SpotColor via scripting, but can do via the UI, so there is no technical reason I can see why this it the case. It may be a simple bug. Also there is a workaround by using defaultFillColor which does apply a SpotColor to a RasterItem.
Steps to reproduce:
1. Start with document containing a bitmap (colourable) RasterItem and a SpotColor swatch.
2. script: (adjust the swatch index to match your SpotColor swatch index)
app.activeDocument.rasterItems[0].colorize(app.activeDocument.swatches[4].color);
Expected result: colorizes the RasterItem.
Actual result: does nothing.
2
votes
![](https://secure.gravatar.com/avatar/e4d01f5222e8d9e09df9e18df34e0653?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)