diff --git a/include/pd/core/color.hpp b/include/pd/core/color.hpp index e613ee3..95eec7c 100755 --- a/include/pd/core/color.hpp +++ b/include/pd/core/color.hpp @@ -59,12 +59,11 @@ class PD_CORE_API Color { * @param a Optional Alpha Value (Defaults to 1.0f) * @note There is no Check if the number is between 0.0 and 1.0 */ - constexpr Color(float r, float g, float b, float a = 1.f) { - r = static_cast(255.f * r); - g = static_cast(255.f * g); - b = static_cast(255.f * b); - a = static_cast(255.f * a); - } + constexpr Color(float r, float g, float b, float a = 1.f) + : r(static_cast(255.f * r)), + g(static_cast(255.f * g)), + b(static_cast(255.f * b)), + a(static_cast(255.f * a)) {} /** * Constructor for Hex Input * @param hex Hex String in `#ffffff` or `#ffffffff` format