Skip to content

Instantly share code, notes, and snippets.

@flibitijibibo
Last active April 16, 2021 22:20
Show Gist options
  • Save flibitijibibo/ffdd7c6fe32b9846a83807dab24be8fd to your computer and use it in GitHub Desktop.
Save flibitijibibo/ffdd7c6fe32b9846a83807dab24be8fd to your computer and use it in GitHub Desktop.
diff --git a/src/Color.cs b/src/Color.cs
index 2499edc..817b67e 100644
--- a/src/Color.cs
+++ b/src/Color.cs
@@ -1392,6 +1392,24 @@ namespace Microsoft.Xna.Framework
private set;
}
+ public static Color CustomRed
+ {
+ get;
+ private set;
+ }
+
+ public static Color CustomGreen
+ {
+ get;
+ private set;
+ }
+
+ public static Color CustomBlue
+ {
+ get;
+ private set;
+ }
+
#endregion
#region Internal Properties
@@ -1422,6 +1440,10 @@ namespace Microsoft.Xna.Framework
static Color()
{
+ CustomRed = new Color(255, 141, 160);
+ CustomGreen = new Color(144, 238, 144);
+ CustomBlue = new Color(113, 231, 255);
+
Transparent = new Color(0);
AliceBlue = new Color(0xfffff8f0);
AntiqueWhite = new Color(0xffd7ebfa);
diff --git a/src/GraphicsDeviceManager.cs b/src/GraphicsDeviceManager.cs
index bb5c33f..8934ff3 100644
--- a/src/GraphicsDeviceManager.cs
+++ b/src/GraphicsDeviceManager.cs
@@ -30,6 +30,10 @@ namespace Microsoft.Xna.Framework
{
get
{
+ if (graphicsDevice == null)
+ {
+ (this as IGraphicsDeviceManager).CreateDevice();
+ }
return graphicsDevice;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment