diff --git a/Source/Engine/Core/Math/Color.cs b/Source/Engine/Core/Math/Color.cs index a8a89ef60..aa3f5f0a5 100644 --- a/Source/Engine/Core/Math/Color.cs +++ b/Source/Engine/Core/Math/Color.cs @@ -230,6 +230,20 @@ namespace FlaxEngine a); } + /// + /// Creates from the RGBA value. + /// + /// The packed RGBA value. + /// The color. + public static Color FromRGBA(uint rgb) + { + return new Color( + ((rgb >> 16) & 0xff) / 255.0f, + ((rgb >> 8) & 0xff) / 255.0f, + (rgb & 0xff) / 255.0f, + ((rgb >> 24) & 0xff) / 255.0f); + } + /// /// Gets the color value as the hexadecimal string. ///