Hot Door CORE Forum

Full Version: accessing a named color (swatch)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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.
Thanks, Garrett, I'm really happy to hear you're adding that! -- rj