Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Color
- {
- public:
- Color ()
- : R ( 0 ),
- G ( 0 ),
- B ( 0 ),
- A ( 0 )
- {
- }
- Color ( int r, int g, int b, int a )
- : R ( r ),
- G ( g ),
- B ( b ),
- A ( a )
- {
- }
- Color ( int r, int g, int b )
- : R ( r ),
- G ( g ),
- B ( b ),
- A ( 255 )
- {
- }
- static Color White ( void ) { return Color ( 255, 255, 255, 255 ); }
- static Color Black ( void ) { return Color ( 0, 0, 0, 255 ); }
- static Color Red ( void ) { return Color ( 255, 0, 0, 255 ); }
- static Color Green ( void ) { return Color ( 0, 255, 0, 255 ); }
- static Color Blue ( void ) { return Color ( 0, 0, 255, 255 ); }
- static Color Cyan ( void ) { return Color ( 0, 127, 255, 255 ); }
- static Color Yellow ( void ) { return Color ( 255, 255, 0, 255 ); }
- int r ( void ) { return R; }
- int g ( void ) { return G; }
- int b ( void ) { return B; }
- int a ( void ) { return A; }
- Color& operator = ( Color& c )
- {
- R = c.r ();
- G = c.g ();
- B = c.b ();
- A = c.a ();
- return *this;
- }
- private:
- int R, G, B, A;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement