Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-06-30 18:55:21 +0300
committerJacques Lucke <jacques@blender.org>2020-06-30 19:18:48 +0300
commitd92e5f895058e3756795aa070a6977c647ff08f8 (patch)
treef0515ba6ac712a7cf59a926a5ab18e5b3d07b44d /source
parent5c9c3a3234a3b0d6284910a7c4cf52e9422521cd (diff)
BLI: support constructing Color4f from float pointer
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenlib/BLI_color.hh4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_color.hh b/source/blender/blenlib/BLI_color.hh
index 432459c9998..37f74edcf4c 100644
--- a/source/blender/blenlib/BLI_color.hh
+++ b/source/blender/blenlib/BLI_color.hh
@@ -28,6 +28,10 @@ struct Color4f {
Color4f() = default;
+ Color4f(const float *rgba) : r(rgba[0]), g(rgba[1]), b(rgba[2]), a(rgba[3])
+ {
+ }
+
Color4f(float r, float g, float b, float a) : r(r), g(g), b(b), a(a)
{
}