You've already forked godot
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user