diff options
author | Stijn Buys <ingar@osirion.org> | 2008-07-23 19:51:06 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-07-23 19:51:06 +0000 |
commit | 5c96b74c76b881b1533432a75d1a8cc42ecc5bda (patch) | |
tree | a1500e0149ba03d017dd5fdb169a6538a7a06a61 /src/math/color.cc | |
parent | 1cf82068a2adff7c401fe0aba73466f045e460d3 (diff) |
fragment renderer
Diffstat (limited to 'src/math/color.cc')
-rw-r--r-- | src/math/color.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/math/color.cc b/src/math/color.cc index 1e52ec5..0cf2ea8 100644 --- a/src/math/color.cc +++ b/src/math/color.cc @@ -123,6 +123,15 @@ Color const operator*(float scalar, Color const & color) { return color * scalar; } + +Color & Color::operator*=(const float scalar) +{ + for (int i=0; i < 3; i++) + rgba_data[i] *= scalar; + return (*this); +} + + std::ostream &operator<<(std::ostream &os, Color const & color) { os << color.red() << " " << color.green() << " " << color.blue(); // << " " << c.alpha(); |