diff --git a/Source/Engine/Core/Math/Color.h b/Source/Engine/Core/Math/Color.h index de79f5b6a..f011709cd 100644 --- a/Source/Engine/Core/Math/Color.h +++ b/Source/Engine/Core/Math/Color.h @@ -138,6 +138,16 @@ public: return Color(static_cast(rgb >> 16 & 0xff) / 255.0f, static_cast(rgb >> 8 & 0xff) / 255.0f, static_cast(rgb & 0xff) / 255.0f, a); } + /// + /// Initializes from packed RGBA value. + /// + /// The packed RGBA value. + /// The color. + static Color FromRGBA(uint32 rgba) + { + return Color(static_cast(rgba >> 16 & 0xff) / 255.0f, static_cast(rgba >> 8 & 0xff) / 255.0f, static_cast(rgba & 0xff) / 255.0f, static_cast(rgba >> 24 & 0xff) / 255.0f); + } + static Color FromHex(const String& hexString) { bool isValid;