diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-05-07 21:16:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-07 21:16:51 +0200 |
commit | ae33cf5f458a57fbf8aa3ec0a65c94e86cd4d6f4 (patch) | |
tree | bad1a6e46923b7ea1f77d328bb47525e5e348d12 /modules/mono/glue | |
parent | bef52957d00c50323824e4fa0a778453214721cf (diff) | |
parent | 90df1d67cbc06f2742c11dad57ca940b9ed7c0d4 (diff) |
Merge pull request #36379 from aaronfranke/color-constructors
Add a Color constructor for Color with alpha
Diffstat (limited to 'modules/mono/glue')
-rw-r--r-- | modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs | 10 |
1 files changed, 9 insertions, 1 deletions
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; |