summaryrefslogtreecommitdiff
path: root/core/math
diff options
context:
space:
mode:
Diffstat (limited to 'core/math')
-rw-r--r--core/math/color.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/math/color.h b/core/math/color.h
index ffd0fd8f6e..815dd98d96 100644
--- a/core/math/color.h
+++ b/core/math/color.h
@@ -94,6 +94,10 @@ struct Color {
void invert();
Color inverted() const;
+ _FORCE_INLINE_ float get_luminance() const {
+ return 0.2126 * r + 0.7152 * g + 0.0722 * b;
+ }
+
_FORCE_INLINE_ Color lerp(const Color &p_to, float p_weight) const {
Color res = *this;