4 * Created on: Sep 1, 2012
8 #ifndef GRAPHICS_COLOR_H_
9 #define GRAPHICS_COLOR_H_
18 Color() :r(0), g(0), b(0), a(255) { }
19 Color(Uint8 r, Uint8 g, Uint8 b, Uint8 a = 255) : r(r), g(g), b(b), a(a) { }
22 Uint8 RedChannel() const { return r; }
23 Uint8 GreenChannel() const { return g; }
24 Uint8 BlueChannel() const { return b; }
25 Uint8 AlphaChannel() const { return a; }
27 Uint32 MapRGB(SDL_PixelFormat *f) const { return SDL_MapRGB(f, r, g, b); }
28 Uint32 MapRGBA(SDL_PixelFormat *f) const { return SDL_MapRGBA(f, r, g, b, a); }
30 void SetRedChannel(Uint8 i) { r = i; }
31 void SetGreenChannel(Uint8 i) { g = i; }
32 void SetBlueChannel(Uint8 i) { b = i; }
33 void SetAlphaChannel(Uint8 i) { a = i; }
42 #endif /* GRAPHICS_COLOR_H_ */