From aaa4ff61f7b17759c4f4ccb3ac9011dd5f8a93f5 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 24 Jul 2008 00:47:13 +0000 Subject: primary, secondary, tertiary color rendering --- src/math/color.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/math') 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; }; -- cgit v1.2.3