Int32 - FromOle

Translates an OLE color value to a GDI+ structure.

Try it

public static void Main()
{
    int oleColor = 0xFF00;

	// C# Extension Method: Int32 - FromOle
    Color color = oleColor.FromOle();

    Console.WriteLine(color.Name);
    Console.WriteLine("R: {0}", color.R);
    Console.WriteLine("G: {0}", color.G);
    Console.WriteLine("B: {0}", color.B);
}

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

public static partial class Extensions
{
#if !NETSTANDARD
    /// <summary>
    ///     Translates an OLE color value to a GDI+  structure.
    /// </summary>
    /// <param name="oleColor">The OLE color to translate.</param>
    /// <returns>The  structure that represents the translated OLE color.</returns>
    public static Color FromOle(this Int32 oleColor)
    {
        return ColorTranslator.FromOle(oleColor);
    }
#endif
}