Saturday, January 6, 2018

What is FromArgb(int32, int32, int32,int32) in creating color by code?

It is from System.Drawing namespace and used in SolidBrush Class.

Its usage syntax in .NET for Windows Universal is:
Windows.UI.Color.FromArgb(byte,byte,byte,byte)

In the above, the first argument is the alpha channel(transparency) that runs from 0 to 255; the next three are red, green and blue channels in that order each from 0 to 255.

For example:
Windows.UI.Color.FromArgb(75, 255, 0,0) produces Background color 'red' with a transparency of 75.

No comments: