/* makeacol_depth: * Converts R, G, B, and A values (ranging 0-255) to whatever pixel format * is required by the specified color depth. */ int makeacol_depth(int color_depth, int r, int g, int b, int a) { switch (color_depth) { case 8: return makecol8(r, g, b); case 15: return makecol15(r, g, b); case 16: return makecol16(r, g, b); case 24: return makecol24(r, g, b); case 32: return makeacol32(r, g, b, a); } return 0; }
int convert_color_to_allegro<IndexedTraits, 15>(color_t color, const Palette* palette) { color_t c = palette->getEntry(color); return makecol15(rgba_getr(c), rgba_getg(c), rgba_getb(c)); }
int convert_color_to_allegro<GrayscaleTraits, 15>(color_t c, const Palette* palette) { return makecol15(graya_getv(c), graya_getv(c), graya_getv(c)); }
int convert_color_to_allegro<RgbTraits, 15>(color_t c, const Palette* palette) { return makecol15(rgba_getr(c), rgba_getg(c), rgba_getb(c)); }