Custom color class not being converted correctly.

can someone tell me why my color class is not being converted correctly to system.drawing.color and back?
I made the class so it would be easier to convert back and forth but it doesn’t seem to be drawing things correctly.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Col1 = Microsoft.Xna.Framework.Color;
using Col2 = System.Drawing.Color;

namespace XEngine.Classes
{
    /// <summary>
    /// A class that combines MonoGame.Color and Systsm.Drawing.Color into a single class
    /// </summary>
    public class Color
    {
        private uint Data = 0;

        //Hell ya a ton of contructors
        public Color()
        {
            Data = (uint)
            (
                000 << 24 +
                000 << 16 +
                000 << 08 +
                255 << 00
            );
        }
        public Color(uint  c)
        {
            Data = c;
        }
        public Color(Col1  c)
        {
            Data = (uint)
            (
                c.R << 24 +
                c.G << 16 +
                c.B << 08 +
                c.A << 00
            );
        }
        public Color(Col2  c)
        {
            Data = (uint)
            (
                c.R << 24 + 
                c.G << 16 + 
                c.B << 08 + 
                c.A << 00
            );
        }
        public Color(Color c)
        {
            Data = (uint)
            (
                c.R << 24 +
                c.G << 16 +
                c.B << 08 +
                c.A << 00
            );
        }
        public Color(byte r, byte g, byte b, byte a)
        {
            Data = (uint)
            (
                r << 24 +
                g << 16 +
                b << 08 +
                a << 00
            );
        }

        public uint RGBA
        {
            get { return Data;  }
            set { Data = value; }
        }
        public byte R
        {
            get { return (byte)((Data  >> 24) & (int)(0xFF)); }
            set { Data = (uint)((value << 24) | (int)(Data)); }
        }
        public byte G
        {
            get { return (byte)((Data  >> 16) & (int)(0xFF)); }
            set { Data = (uint)((value << 16) | (int)(Data)); }
        }
        public byte B
        {
            get { return (byte)((Data  >> 08) & (int)(0xFF)); }
            set { Data = (uint)((value << 08) | (int)(Data)); }
        }
        public byte A
        {
            get { return (byte)((Data  >> 00) & (int)(0xFF)); }
            set { Data = (uint)((value << 00) | (int)(Data)); }
        }

        public Col1 ToXnaColor()
        {
            return new Col1(R,G,B,A);
        }
        public Col2 ToSysColor()
        {
            return Col2.FromArgb(A,R,G,B);
        }
        public void FromXnaColor(Col1 color)
        {
            R = color.R;
            G = color.G;
            B = color.B;
            A = color.A;
        }
        public void FromSysColor(Col2 color)
        {
            R = color.R;
            G = color.G;
            B = color.B;
            A = color.A;
        }
    }
}

You don’t need to make things like this more complicated than it should be in my opinion.

You could for example create a static extensions class and convert Colors directly like this:

public static Microsoft.Xna.Framework.Color ToXNA(this Color drawingColor)
{
    return new Microsoft.Xna.Framework.Color(drawingColor.R, drawingColor.G, drawingColor.B, drawingColor.A);
}

public static Color ToDrawing(this Microsoft.Xna.Framework.Color drawingColor)
{
    return Color.FromArgb(drawingColor.A, drawingColor.R, drawingColor.G, drawingColor.B);
}

Then use it like this:

System.Drawing.Color drawingColor = System.Drawing.Color.White;
Microsoft.XNA.Framework.Color xnaColor = drawingColor.ToXNA();

This is way easier.

what exactly is a extension class? is that like if I derive from monogame.color?
I kinda wanted to have my own class library with monogame hidden behind it.
I don’t even use the pipeline at the moment.

Here’s how I construct a uint from 4 channel values.

public static uint FromRGBA(byte red, byte green, byte blue, byte alpha)
{
    return (uint) (alpha << 24 | blue << 16 | green << 8 | red);
}

What’s happening now when you have pure red and convert it to System.Drawing and vice versa? Do you get a different color? Which one?

With an extension class you extend the functionallity of a different class (like the name implies).

You simply create a new class file in your project and name it like Extensions.cs and make it static. Then create the extensions for classes you want to extend like System.Drawing.Color (see my example above).

If you want more information please take a look at this link:
https://www.dotnetperls.com/extension