ICM Color Structures

[This is preliminary documentation and subject to change.]

This group of structures is used to specify colors for translation.

The GRAYCOLOR Structure

struct GRAYCOLOR {
    WORD    gray;
};
 

The RGBCOLOR Structure

struct RGBCOLOR {
    WORD    red;
    WORD    green;
    WORD    blue;
};
 

The CMYKCOLOR Structure

struct CMYKCOLOR {
    WORD    cyan;
    WORD    magenta;
    WORD    yellow;
    WORD    black;
};
 

The XYZCOLOR Structure

struct XYZCOLOR {
    WORD    X;
    WORD    Y;
    WORD    Z;
};
 

The YxyCOLOR Structure

struct YxyCOLOR {
    WORD    Y;
    WORD    x;
    WORD    y;
};
 

The L*a*bCOLOR Structure

struct LabCOLOR {
    WORD    L;
    WORD    a;
    WORD    b;
};
 

The GENERIC3CHANNEL Structure

struct GENERIC3CHANNEL {
    WORD    ch1;
    WORD    ch2;
    WORD    ch3;
};
 

The NAMEDCOLOR Structure

struct NAMEDCOLOR {
    DWORD   dwIndex;
};
 

The HiFiCOLOR Structure

struct HiFiCOLOR {
    BYTE    channel[MAX_COLOR_CHANNELS];
};
 

The COLOR Structure

typedef union tagCOLOR {
    struct GRAYCOLOR        gray;
    struct RGBCOLOR         rgb;
    struct CMYKCOLOR        cmyk;
    struct XYZCOLOR         XYZ;
    struct YxyCOLOR         Yxy;
    struct LabCOLOR         Lab;
    struct GENERIC3CHANNEL  gen3ch;
    struct NAMEDCOLOR       named;
    struct HiFiCOLOR        hifi;
} COLOR;
 

A variable of type COLOR may be accessed as any of the supported color space colors by accessing the appropriate member of the union. For instance, given the following variable declaration

COLOR aColor;
 

The red, green and blue values could be set in the following manner:

aColor.rgb.red=100;
aColor.rgb.green=50;
aColor.rgb.blue=2;
 

See Also

Color Management Overview, ICM 2.0 Structures