Hot Door CORE Forum
accessing a named color (swatch) - Printable Version

+- Hot Door CORE Forum (http://hotdoorcore.com/forum)
+-- Forum: All forums (http://hotdoorcore.com/forum/forumdisplay.php?fid=1)
+--- Forum: Getting started (http://hotdoorcore.com/forum/forumdisplay.php?fid=6)
+--- Thread: accessing a named color (swatch) (/showthread.php?tid=234)



accessing a named color (swatch) - Rick Johnson - 05-05-2020

hdicoreArtColor.h includes a function to create a named custom color. According to the docs, the named color is automatically added to the swatches panel, even though "makeNamed" operated successfully.

Code:
hdi::core::ArtColor aColor = hdi::core::ArtColor::white();
bool success = aColor.makeNamed("TestColor");

Am I doing something wrong?

Also, how would one retrieve a named swatch color? I would expect to find it in either hdicoreArtColor.h or more likely hdicoreCurrentDocument.h, but don't see anything.

I would presume that a document's colors are stored in its dictionary and thought I could find named colors there, but stepping through the document dictionary I don't see any entries of ArtColorType (presumably because it's "Reserved for future use").

Any suggestions would be much appreciated.


RE: accessing a named color (swatch) - garrett - 06-30-2020

I'm sorry to say that the documentation has a typo, and should state that the named color is not added to the swatches panel.

Regarding accessing the swatches from the document (and adding a color to the list), we have not yet implemented Adobe's underlying AISwatchListSuite in hdi_core. This is a good feature to consider for future inclusion though, so I will add it to the list.

If you need to access/manipulate the swatch list before then, you can always work with the AISwatchListSuite directly.


RE: accessing a named color (swatch) - Rick Johnson - 07-04-2020

Thanks, Garrett, I'm really happy to hear you're adding that! -- rj