From 90df1d67cbc06f2742c11dad57ca940b9ed7c0d4 Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Thu, 18 Jul 2019 20:15:39 -0400 Subject: Color with alpha constructor --- modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'modules/mono/glue') diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs index facaf74606..6030b72a44 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs @@ -420,7 +420,7 @@ namespace Godot return txt; } - // Constructors + // Constructors public Color(float r, float g, float b, float a = 1.0f) { this.r = r; @@ -429,6 +429,14 @@ namespace Godot this.a = a; } + public Color(Color c, float a = 1.0f) + { + r = c.r; + g = c.g; + b = c.b; + this.a = a; + } + public Color(uint rgba) { a = (rgba & 0xFF) / 255.0f; -- cgit v1.2.3