How to

get color from ARGB

Published: 24. October 2011 | Updated: 26. October 2011
License: Microsoft Public License (MS-PL)
Categories: Converting » Colors
Tags: C# Colors Conversion Winforms WPF
Was this snippet helpful for you? YESYES / NONO

In WPF

using System.Windows.Media;
byte alpha = 255;
byte red = 150;
byte green = 200;
byte blue = 50;
Color color = Color.FromArgb(alpha, red, green, blue);

In Winforms

using System.Drawing;
int alpha = 255;
int red = 150;
int green = 200;
int blue = 50;
Color color = Color.FromArgb(alpha, red, green, blue);
Send us feedback about this snippet »



Related Snippets: