1makecol8(3) Allegro manual makecol8(3)
2
3
4
6 makecol8, makecol15, makecol16, makecol24, makecol32 - Converts an RGB
7 value into a display dependent pixel format. Allegro game programming
8 library.
9
11 #include <allegro.h>
12
13
14 int makecol8(int r, int g, int b);
15
16 int makecol15(int r, int g, int b);
17
18 int makecol16(int r, int g, int b);
19
20 int makecol24(int r, int g, int b);
21
22 int makecol32(int r, int g, int b);
23
25 These functions convert colors from a hardware independent form (red,
26 green, and blue values ranging 0-255) into various display dependent
27 pixel formats. Converting to 15, 16, 24, or 32-bit formats only takes a
28 few shifts, so it is fairly efficient. Converting to an 8-bit color
29 involves searching the palette to find the closest match, which is
30 quite slow unless you have set up an RGB mapping table (see below).
31 Example:
32
33 /* 16 bit color version of green. */
34 int green_color = makecol16(0, 255, 0);
35
37 Returns the requested RGB triplet in the specified color depth.
38
39
41 makeacol32(3), makecol(3), makecol_depth(3), makecol15_dither(3),
42 rgb_map(3), bestfit_color(3), set_color_depth(3), exrgbhsv(3)
43
44
45
46Allegro version 4.4.3 makecol8(3)