Get color of text, odd results....


i'm trying color of chunk of text, can size, font, etc... struggling getting color.

 

when use code

 

interfaceptr<const iattrreport> fontcolorattrreport(icomposescanner->queryattributeat(charcounter,charcounter + 1,ktextattrcolorboss,null));

interfaceptr<const itextattruid> fontcolorattr(fontcolorattrreport, iid_itextattruid);

uid coloruid = fontcolorattr->get();

int32 colorspace;

colorarray colorarray;

pmreal tint;

utils<icolorsystemutils>()->getcolorswatchcolorspaceandvalue(uidref(::getdatabase(txtmodel ),coloruid), colorspace,colorarray,tint);

 

widestring colorinfostring = widestring(utils<icolorsystemutils>()->getcolorinfostring(colorspace,colorarray,ktrue));

the colorinfostring comes this
r=1 g=1 b=1
or
c=0 m=1 y=0 k=0
the thing is, these results wrong, values rounded or down, example, rgb value pale green, not pure green value suggest.
not sure i'm doing wrong here.
i want r,g,b values or cmyk, depending on colorspace.
hope can help, i'm sure i'm doing stupid.
cheers
mt

colorarray values real numbers, error may displaying them integers ...

 

agh -- sorry! getcolorinfostring formats you.

 

(reminder self: not post in sdk forum )



More discussions in InDesign SDK


adobe

Comments

Popular posts from this blog

How to decompile jsxbin to jsx

Gavik Photoslide GK2: Not able to upload photos - Joomla! Forum - community, help and support

Phoca Guestbook logger registret bruger af - Joomla! Forum - community, help and support