aboutsummaryrefslogtreecommitdiffstatsci
path: root/Drawing2D/src
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2025-07-16 20:08:03 +0200
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2025-07-16 20:08:03 +0200
commit149205e8ebe5c4ab1ca52ca700ff754aabdf14aa (patch)
treee0d567ae9a304ec915e49a25e42af1803e3d83ed /Drawing2D/src
parente96fecb4bb512ee47e9df0224e779b24d686bc30 (diff)
DebugLogViewer, DockTests
Diffstat (limited to 'Drawing2D/src')
-rw-r--r--Drawing2D/src/Colors.cs14
1 files changed, 4 insertions, 10 deletions
diff --git a/Drawing2D/src/Colors.cs b/Drawing2D/src/Colors.cs
index a20770e6..d7db8e7e 100644
--- a/Drawing2D/src/Colors.cs
+++ b/Drawing2D/src/Colors.cs
@@ -164,10 +164,10 @@ namespace Drawing2D
public struct Color : IEquatable<Color>
{
#region CTOR
- public Color (int r, int g, int b, int a) :
+ public Color (int r, int g, int b, int a = 255) :
this ((uint)r, (uint)g, (uint)b, (uint)a) { }
- public Color(uint r, uint g, uint b, uint a)
+ public Color(uint r, uint g, uint b, uint a = 255)
{
value =
((r & 0xFF) << 24) +
@@ -175,7 +175,7 @@ namespace Drawing2D
((b & 0xFF) << 8) +
((a & 0xFF));
}
- public Color (byte r, byte g, byte b, byte a)
+ public Color (byte r, byte g, byte b, byte a = 0xff)
{
value = ((uint)r << 24) + ((uint)g << 16) + ((uint)b << 8) + a;
}
@@ -223,13 +223,6 @@ namespace Drawing2D
set => this.value = (value & 0x000000FF);
}
-
-
-
- /*public string Name;
- public string htmlCode;
- internal bool predefinied;*/
-
#region Operators
/*public static implicit operator string(Color c) => c.ToString();
@@ -382,5 +375,6 @@ namespace Drawing2D
return new Color (X + m, C + m, m, _alpha / 255.0);
return new Color (C + m, X + m, m, _alpha / 255.0);
}
+ public static Color FromRGBA (int r, int g, int b, int a = 255) => new Color(r, g, b, a);
}
}