summaryrefslogtreecommitdiff
path: root/indra/llmath/v4color.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmath/v4color.h')
-rw-r--r--indra/llmath/v4color.h16
1 files changed, 4 insertions, 12 deletions
diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h
index 785b47dd37..7414c38847 100644
--- a/indra/llmath/v4color.h
+++ b/indra/llmath/v4color.h
@@ -72,14 +72,9 @@ class LLColor4
return ret;
}
- void setValue(const LLSD& sd)
- {
- mV[0] = (F32) sd[0].asReal();
- mV[1] = (F32) sd[1].asReal();
- mV[2] = (F32) sd[2].asReal();
- mV[3] = (F32) sd[3].asReal();
- }
+ void setValue(const LLSD& sd);
+ void setHSL(F32 hue, F32 saturation, F32 luminance);
void calcHSL(F32* hue, F32* saturation, F32* luminance) const;
const LLColor4& setToBlack(); // zero LLColor4 to (0, 0, 0, 1)
@@ -249,7 +244,7 @@ inline LLColor4::LLColor4(void)
inline LLColor4::LLColor4(const LLSD& sd)
{
- *this = sd;
+ this->setValue(sd);
}
inline LLColor4::LLColor4(F32 r, F32 g, F32 b)
@@ -641,10 +636,7 @@ void LLColor4::clamp()
inline const LLColor4& LLColor4::operator=(const LLSD& sd)
{
- mV[0] = (F32) sd[0].asReal();
- mV[1] = (F32) sd[1].asReal();
- mV[2] = (F32) sd[2].asReal();
- mV[3] = (F32) sd[3].asReal();
+ setValue(sd);
return *this;
}