1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-23 15:16:17 +00:00

Merge pull request #36379 from aaronfranke/color-constructors

Add a Color constructor for Color with alpha
This commit is contained in:
Rémi Verschelde
2020-05-07 21:16:51 +02:00
committed by GitHub
5 changed files with 41 additions and 7 deletions

View File

@@ -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;