Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/math
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-07-24 00:47:13 +0000
committerStijn Buys <ingar@osirion.org>2008-07-24 00:47:13 +0000
commitaaa4ff61f7b17759c4f4ccb3ac9011dd5f8a93f5 (patch)
treefafec5ef0c99f28cfa6b5b652d98b63b7a4673de /src/math
parent11c122eb1cc86ca1a40c84eb411ccd97791dc47d (diff)
primary, secondary, tertiary color rendering
Diffstat (limited to 'src/math')
-rw-r--r--src/math/color.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/math/color.h b/src/math/color.h
index 4f3df16..c938708 100644
--- a/src/math/color.h
+++ b/src/math/color.h
@@ -49,7 +49,22 @@ public:
/// multiply rgb values with scalar value.
Color & operator*=(const float scalar);
- inline float operator[](size_t index) const { return rgba_data[index]; }
+ /// assign a value to an element of this color
+ /*! WARNING: range is not checked
+ * @param index the index of the element to assign to ( 0 <= index < 4 )
+ */
+ inline float& operator[](const size_t index) {
+ return rgba_data[index];
+ }
+
+ /// returns the value of an element of this color
+ /*! WARNING: range is not checked
+ * @param index the index of the element to return ( 0 <= index < 4 )
+ */
+ inline float operator[](const size_t index) const {
+ return rgba_data[index];
+ }
+
/// pointer to the internal data
inline float *ptr() const { return (float *) rgba_data; };