[Bf-blender-cvs] [d92e5f89505] master: BLI: support constructing Color4f from float pointer

Jacques Lucke noreply at git.blender.org
Tue Jun 30 18:20:21 CEST 2020


Commit: d92e5f895058e3756795aa070a6977c647ff08f8
Author: Jacques Lucke
Date:   Tue Jun 30 17:55:21 2020 +0200
Branches: master
https://developer.blender.org/rBd92e5f895058e3756795aa070a6977c647ff08f8

BLI: support constructing Color4f from float pointer

===================================================================

M	source/blender/blenlib/BLI_color.hh

===================================================================

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)
   {
   }



More information about the Bf-blender-cvs mailing list