Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

color.h

Go to the documentation of this file.
00001 /* ***********************************************************************************
00002         Writer:         Sebastien Bloc
00003         Copyright:      2003-2004
00004         eMail:          sebastien.bloc@free.fr
00005         URL:            http://mignonsoft.free.fr
00006 
00007         This program is free software; you can redistribute it and/or
00008         modify it under the terms of the GNU General Public License
00009         as published by the Free Software Foundation; either version 2
00010         of the License, or (at your option) any later version.
00011 
00012         This program is distributed in the hope that it will be useful,
00013         but WITHOUT ANY WARRANTY; without even the implied warranty of
00014         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015         GNU General Public License for more details.
00016         http://www.gnu.org/copyleft/gpl.html
00017 *********************************************************************************** */
00018 
00023 #ifndef INCLUDE_3D_COLOR_H
00024 #define INCLUDE_3D_COLOR_H
00025 
00026 typedef struct 
00027 {
00028         float r;
00029         float g;
00030         float b;
00031         float a;
00032 } RGBA;
00033 
00040 class Color
00041 {
00042 public: 
00043         union
00044         {
00045                 float value[4];
00046                 struct 
00047                 {
00048                         float r;
00049                         float g;
00050                         float b;
00051                         float a;
00052                 };
00053         };
00054         BOOL isEnable;
00055 
00056 public:
00057         Color();
00058         Color(float r,float g,float b,float a);
00059         Color(float rgba);
00060         void Zero();
00061         void operator=(Color &source);
00062         void operator=(float *source);
00063 
00064         void SetNull();
00065         void SetFull();
00066         void Set(float _r,float _g,float _b);
00067         void Set(float _r,float _g,float _b,float _a);
00068         operator float *() const;
00069         void ToString (MyString &text);
00070 };
00071 
00072 #endif

Generated on Fri Aug 20 19:19:43 2004 for 3d Controls by doxygen 1.3.6