var idoc = app.activeDocument; var ipath = idoc.pathItems; icolor = ipath.fillColor; alert(icolor.typename);
Thanx for the reply carlos....
But I am not able to use "
icolor.typename". There is nothing like "typename" showing in the properties.
I am using it like this:
var app:com.adobe.illustrator.Application = Illustrator.app;
var allPaths:PathItems = doc.pathItems;
if ( app.documents.length > 0 && doc.pathItems.length > 0)
//Fill color to the selected object.
for (var i:int = 0; i < doc.pathItems.length ; ++i)
pathArt = allPaths.index(i);
colorValue = pathArt.fillColor;
trace(colorValue.typename); //But colorValue doesn't show any property like "typename".
Do am i missing some thing?
what's that? actionscript?
did you try the sample I posted? try to duplicate the same sample in your version (as?), to see if it works.
I think the problem is here
can you run your code without declaring the colorValue first? comment it out to see if it works.
I tried your code and mine as well. It works fine if the document color mode is "RGB Color" but in case of "CMYK Color", it throws an exception
Error: In wrapReturnedHostObject(), attempted invalid wrap: com.adobe.illustrator::CMYKColor returned as com.adobe.illustrator::Color.
I don't know why.
But In rgb mode also, when i tried ur code and debug it, then line "
icolor.typename" returns the "RGBColor". But that's not what i want. I just want to know the value of 'color type' i.e. spot color or process color.
Let me give you some more info may be it will help you to understand my problem..
I have a cmyk color mode document containing some art objects. These art objects are filled with some process color and some spot colors. When I select any art object, which is filled with some color, I want to get the 'color type' of the filled color and if it is possible then its value(r, g, b) and name too.
Is it possible to get all of these?