#ifndef palette_h
#define palette_h

#include "windows.h"
#include <InterViews\color.h>

const int PALETTESIZE = 236;

struct LOG_PALETTE {
    WORD palVersion;
    WORD palNumEntries;
    PALETTEENTRY palPalEntry[PALETTESIZE];
};

class Palette {
public:
    Palette();
    ~Palette();

    void Realize(HDC);
    int  SetEntry(ColorIntensity, ColorIntensity, ColorIntensity);
    int  GetPaletteIndex(DWORD);
    HPALETTE GetPalette()	{ return pal; };

private:
    friend class Color;

    LOG_PALETTE *logPal;
    HPALETTE    pal;
    int         max_entry;
};

Palette* _palette;

#endif