summaryrefslogtreecommitdiff
path: root/indra/llmath/v3colorutil.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmath/v3colorutil.h')
-rw-r--r--indra/llmath/v3colorutil.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/llmath/v3colorutil.h b/indra/llmath/v3colorutil.h
index 00b36132d8..6d8cd9329b 100644
--- a/indra/llmath/v3colorutil.h
+++ b/indra/llmath/v3colorutil.h
@@ -91,5 +91,25 @@ inline LLColor3 smear(F32 val)
return LLColor3(val, val, val);
}
+inline F32 color_intens(const LLColor3 &col)
+{
+ return col.mV[0] + col.mV[1] + col.mV[2];
+}
+
+inline F32 color_max(const LLColor3 &col)
+{
+ return llmax(col.mV[0], col.mV[1], col.mV[2]);
+}
+
+inline F32 color_max(const LLColor4 &col)
+{
+ return llmax(col.mV[0], col.mV[1], col.mV[2]);
+}
+
+
+inline F32 color_min(const LLColor3 &col)
+{
+ return llmin(col.mV[0], col.mV[1], col.mV[2]);
+}
#endif