diff --git a/include/CColor.hpp b/include/CColor.hpp index bbfd051..cbbc4ee 100644 --- a/include/CColor.hpp +++ b/include/CColor.hpp @@ -294,6 +294,9 @@ public: void fromHSL(float h, float s, float l, float _a = 1.0); void toHSL(float& h, float& s, float& l); + + CColor toGrayscale() + { return {Math::sqrtF(magSquared() / 3)}; } }; static inline CColor operator+(float lhs, const CColor& rhs)