Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. class Color
  2. {
  3.     int _color[4];
  4. public:
  5.     Color( )
  6.     {
  7.         _SetColor( 0, 0, 0, 0 );
  8.     }
  9.     Color( int r, int g, int b, int a = 255 )
  10.     {
  11.         _SetColor( r, g, b, a );
  12.     }
  13.  
  14.     void SetColor( int r, int g, int b )
  15.     {
  16.         _SetColor( r, g, b );
  17.     }
  18.  
  19.     __inline int _r( ) const { return _color[0]; }
  20.     __inline int _g( ) const { return _color[1]; }
  21.     __inline int _b( ) const { return _color[2]; }
  22.     __inline int _a( ) const { return _color[3]; }
  23.  
  24. private:
  25.     void _SetColor( int r, int g, int b, int a = 255 )
  26.     {
  27.         _color[0] = r;
  28.         _color[1] = g;
  29.         _color[2] = b;
  30.         _color[3] = a;
  31.     }
  32. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement