diff options
| author | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-10-06 12:52:40 +0200 |
|---|---|---|
| committer | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-10-06 12:53:07 +0200 |
| commit | af64f953d4f01a7c7bd3415ff5edfff8d4f7c48d (patch) | |
| tree | ee6060a549c311ffa02b4a604bd9059f0465b237 /src/glcolorrgba.h | |
| download | Multimedia-af64f953d4f01a7c7bd3415ff5edfff8d4f7c48d.tar.gz Multimedia-af64f953d4f01a7c7bd3415ff5edfff8d4f7c48d.zip | |
Initial commit
Diffstat (limited to 'src/glcolorrgba.h')
| -rw-r--r-- | src/glcolorrgba.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/glcolorrgba.h b/src/glcolorrgba.h new file mode 100644 index 0000000..53efcc2 --- /dev/null +++ b/src/glcolorrgba.h @@ -0,0 +1,38 @@ +#ifndef GLCOLORRGBA_H +#define GLCOLORRGBA_H + +#include <QVector4D> +/** + * @brief The GlColorRgba class is a convenience class to replace QVector4D for color variables. + */ +class GLColorRgba: public QVector4D{ +public: + GLColorRgba(float r = 0.0, float g= 0.0, float b = 0.0, float a = 1.0); + GLColorRgba(const GLColorRgba & other); + GLColorRgba(const QVector4D & other); + /** + * Returns the inverted color with a= 1.0 + */ + GLColorRgba inverted(); + + GLColorRgba operator * (float factor); + //convenience getters + float red()const{return x();} + float green()const{return y();} + float blue()const{return z();} + float alpha()const{return w();} + +//predefined colors + static GLColorRgba clBlack; + static GLColorRgba clRed; + static GLColorRgba clYellow; + static GLColorRgba clGreen; + static GLColorRgba clCyan; + static GLColorRgba clBlue; + static GLColorRgba clMagenta; + static GLColorRgba clGray; + static GLColorRgba clWhite; +}; + + +#endif // GLCOLORRGBA_H |
