incorporate drawable and annotations
[mussa.git] / alg / color.cpp
index 1c01f892941f51eb05d1065c4795b7d1ce5a4367..ffc974cb3e6068c08e3d285fb1c2623c80347885 100644 (file)
@@ -19,6 +19,14 @@ Color::Color(float red, float green, float blue, float alpha)
   set(red, green, blue, alpha);
 }
 
+Color::Color(const ColorRef c)
+{
+  set(c->colors[RedChannel], 
+      c->colors[GreenChannel], 
+      c->colors[BlueChannel], 
+      c->colors[AlphaChannel]);
+}
+
 void Color::set(float r, float g, float b, float a)
 {
   colors[RedChannel]   = r;
@@ -90,8 +98,6 @@ bool operator==(const Color &x, const Color &y)
 
 std::ostream &operator<<(std::ostream &out, const Color &c)
 {
-  out << "Color(" << c.r() << ", " 
-                    << c.g() << ", " 
-                    << c.b() << ", " 
-                    << c.a() << ")";
+  out << c.r() << " " << c.g() << " " << c.b() << " " << c.a();
+  return out;
 }