TColor to System.Drawing.Color

I am looking for information on how to send a Delphi TColor to a .NET visual plugin so it can change a color property of type System.Drawing.Color

Thanks

Hello

TColor is just a 4-byte number that contains color info as 0x00BBGGRR : http://docwiki.embarcadero.com/Libraries/Rio/en/Vcl.Graphics.TColor

Extract color bytes using code like

red := Byte(color);
green := Byte(color shr 8);
blue := Byte(color shr 16);

System.Drwing.Color in its turn provides method https://docs.microsoft.com/en-us/dotnet/api/system.drawing.color.fromargb?view=netframework-4.8#System_Drawing_Color_FromArgb_System_Int32_ which expects incoming value as 0xAARRGGBB.

So take your color component values and compose a number like

(red shl 16) or (green shl 8) or blue

then pass this number from delphi to .NET and use it there to create a Color instance.