Convert colors to RGB
Hello,
I need to color convert path items stroke/fill in CMYK colorspace to RGB colorspace - essentially the functionality given by Edit > Edit Colors > Convert to RGB.
In my code, I first select the path items. I then invoke the Convert to RGB menu action. However, nothing really happens. The colors stay in CMYK.
The document color mode is RGB.
// Select all paths
error = CollectPaths(&store, &count);
ai::int32 index = 0;
for (index = 0; index < count; index++)
{
AIArtHandle art = (*store)[index];
ai::int32 attr;
error = sAIArt->GetArtUserAttr(art, kArtLocked | kArtHidden, &attr);
if (!(attr & (kArtLocked | kArtHidden)))
{
error = sAIArt->SetArtUserAttr(art, kArtSelected, kArtSelected);
}
}
// Invoke Convert To RGB
AICommandID convertCmd;
sAICommandManager->GetCommandIDFromName(kColors9CommandStr, &convertCmd);
error = sAIMenu->InvokeMenuAction(convertCmd);
This is what CollectPaths looks like:
ASErr CollectPaths(AIArtHandle ***store, ai::int32 *count)
{
*store = NULL;
*count = 0;
AIMatchingArtSpec specs;
ai::int16 numSpecs = 1;
specs.type = kPathArt;
specs.whichAttr = 0;
ASErr error = sAIMatchingArt->GetMatchingArt(&specs, numSpecs, store, count);
return error;
}
Any ideas why the menu action does nothing?
Is it in disabled state because of some reason?
Thanks,
MT
