Specifying Color using .FromArgb and .FromName

Questions about MultiCharts .NET and user contributed studies.
SSS
Posts: 14
Joined: 01 Apr 2013
Has thanked: 10 times
Been thanked: 2 times

Specifying Color using .FromArgb and .FromName

Postby SSS » 24 Apr 2013

Other than specifying a color by name (e.g. Color.Blue, Color.Yellow) etc, how do I define a colour using the methods Color.FromName or Color.FromArgb?

I've been experimenting and none of the following seem to work:

Code: Select all

myObject.Color = Color.FromArgb(-1);
myObject.Color = Color.FromArgb(-16711681);
myObject.Color = Color.FromArgb(-256);

myObject.Color = Color.FromName("ff008000");
myObject.Color = Color.FromName("ffffff00");
All the above seem to produce a black color with the values (A=255, R=0, G=0, B=0). What am I doing wrong?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Specifying Color using .FromArgb and .FromName

Postby Henry MultiСharts » 25 Apr 2013

Hello SSS,

Here is how to define colour using methods Color.FromName and Color.FromArgb.


Return to “MultiCharts .NET”