summaryrefslogtreecommitdiff
path: root/indra/llmath/v3color.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmath/v3color.cpp')
-rw-r--r--indra/llmath/v3color.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/indra/llmath/v3color.cpp b/indra/llmath/v3color.cpp
new file mode 100644
index 0000000000..2dbc368d98
--- /dev/null
+++ b/indra/llmath/v3color.cpp
@@ -0,0 +1,44 @@
+/**
+ * @file v3color.cpp
+ * @brief LLColor3 class implementation.
+ *
+ * Copyright (c) 2000-$CurrentYear$, Linden Research, Inc.
+ * $License$
+ */
+
+#include "linden_common.h"
+
+#include "v3color.h"
+#include "v4color.h"
+
+LLColor3 LLColor3::white(1.0f, 1.0f, 1.0f);
+LLColor3 LLColor3::black(0.0f, 0.0f, 0.0f);
+LLColor3 LLColor3::grey (0.5f, 0.5f, 0.5f);
+
+LLColor3::LLColor3(const LLColor4 &a)
+{
+ mV[0] = a.mV[0];
+ mV[1] = a.mV[1];
+ mV[2] = a.mV[2];
+}
+
+LLColor3::LLColor3(const LLSD &sd)
+{
+ mV[0] = (F32) sd[0].asReal();
+ mV[1] = (F32) sd[1].asReal();
+ mV[2] = (F32) sd[2].asReal();
+}
+
+const LLColor3& LLColor3::operator=(const LLColor4 &a)
+{
+ mV[0] = a.mV[0];
+ mV[1] = a.mV[1];
+ mV[2] = a.mV[2];
+ return (*this);
+}
+
+std::ostream& operator<<(std::ostream& s, const LLColor3 &a)
+{
+ s << "{ " << a.mV[VX] << ", " << a.mV[VY] << ", " << a.mV[VZ] << " }";
+ return s;
+}