1 #ifndef GRAPHICS_COLOR_H_
2 #define GRAPHICS_COLOR_H_
11 Color() :r(0), g(0), b(0), a(255) { }
12 Color(Uint8 r, Uint8 g, Uint8 b, Uint8 a = 255) : r(r), g(g), b(b), a(a) { }
15 Uint8 RedChannel() const { return r; }
16 Uint8 GreenChannel() const { return g; }
17 Uint8 BlueChannel() const { return b; }
18 Uint8 AlphaChannel() const { return a; }
20 Uint32 MapRGB(SDL_PixelFormat *f) const { return SDL_MapRGB(f, r, g, b); }
21 Uint32 MapRGBA(SDL_PixelFormat *f) const { return SDL_MapRGBA(f, r, g, b, a); }
23 void SetRedChannel(Uint8 i) { r = i; }
24 void SetGreenChannel(Uint8 i) { g = i; }
25 void SetBlueChannel(Uint8 i) { b = i; }
26 void SetAlphaChannel(Uint8 i) { a = i; }