...

Online Help for Chasys Draw IES: SDK - Layer Attachments - CPAL


SDK - Layer Attachments - CPAL
 

Using the CPAL meta-type

The CPAL attachment (Color Palette) allows plug-ins that load files with palettes to share those palettes with Chasys Draw IES. Such palettes may be used to populate the Palette window in the user interface for Chasys Draw IES. The metadata consists of a host-defined structure of a fixed length:

#define META_CPAL_VERSION           0x0001

struct meta_CPAL_Obj
{
    unsigned short  version;        //CPAL version
    unsigned short  count;          //number of colors in palette
    unsigned char   unused_1;       //unused, set to 0
    unsigned char   colors[256];    //flags
};

The plug-in requests metadata of size sizeof(meta_CPAL_Obj). The plug-in then proceeds to fill the structure with the colors in the palette, the number of colors and the version of the structure.