1getr(3) Allegro manual getr(3)
2
3
4
6 getr, getg, getb, geta - Extract a color component from the current
7 pixel format. Allegro game programming library.
8
10 #include <allegro.h>
11
12
13 int getr(int c);
14
15 int getg(int c);
16
17 int getb(int c);
18
19 int geta(int c);
20
22 Given a color in the format being used by the current video mode, these
23 functions extract one of the red, green, blue, or alpha components
24 (ranging 0-255), calling the preceding 8, 15, 16, 24, or 32-bit get
25 functions as appropriate. The alpha part is only meaningful for 32-bit
26 pixels. Example:
27
28 int r, g, b, color_value;
29
30 color_value = getpixel(screen, 100, 100);
31 r = getr(color_value);
32 g = getg(color_value);
33 b = getb(color_value);
34
35
37 getr8(3), getr_depth(3), makecol(3), set_color_depth(3), exalpha(3)
38
39
40
41Allegro version 4.4.2 getr(3)