Color - ToOle

Translates the specified structure to an OLE color.

Try it

public static void Main()
{
    Color myColor = Color.Red;
    
	//C# Extension Method: Color - ToOle
	int oleColor = myColor.ToOle();
	Console.WriteLine(oleColor);
}

View Source
using System;
#if !NETSTANDARD
using System.Drawing;
#endif

public static partial class Extensions
{
#if !NETSTANDARD
    /// <summary>
    ///     Translates the specified  structure to an OLE color.
    /// </summary>
    /// <param name="c">The  structure to translate.</param>
    /// <returns>The OLE color value.</returns>
    public static Int32 ToOle(this Color c)
    {
        return ColorTranslator.ToOle(c);
    }
#endif
}