System.Windows.Media.Color.FromArgb C# (CSharp) Method

FromArgb() public static method

public static FromArgb ( byte a, byte r, byte g, byte b ) : Color
a byte
r byte
g byte
b byte
return Color
		public static Color FromArgb (byte a, byte r, byte g, byte b)
		{
			return new Color ((uint)(a << 24 | r << 16 | g << 8 | b));
		}

Usage Example

Beispiel #1
0
        RadialGradientBrush MakeRadialBrush()
        {
            var brush = new RadialGradientBrush
            {
                GradientStops = new GradientStopCollection
                {
                    new GradientStop
                        (Color.FromArgb
                            ((byte)rnd.Next(0, 256),
                            (byte)rnd.Next(0, 256),
                            (byte)rnd.Next(0, 256),
                            (byte)rnd.Next(0, 256)),
                        0.0),
                    new GradientStop
                        (Color.FromArgb
                            ((byte)rnd.Next(0, 256),
                            (byte)rnd.Next(0, 256),
                            (byte)rnd.Next(0, 256),
                            (byte)rnd.Next(0, 256)),
                        1.0)
                }
            };

            return(brush);
        }
All Usage Examples Of System.Windows.Media.Color::FromArgb