Ejemplo n.º 1
0
        /// <summary>
        ///     Converts a System Color to <c>Rgba</c> format.
        /// </summary>
        /// <param name="color">
        ///     The color
        /// </param>
        /// <returns>
        ///     The <see cref="int" /> in 0xRRGGBBAA format.
        /// </returns>
        public static int ToRgba(this global::System.Drawing.Color color)
        {
            var x = color.ToArgb();

            return((int)((x & 0xFF000000) >> 0x18) | ((x & 0x00FF0000) << 0x8) | ((x & 0x0000FF00) << 0x8)
                   | ((x & 0x000000FF) << 0x8));
        }