[MonoDevelop] Gdk# Color Parse function

Michael Hutchinson m.j.hutchinson at gmail.com
Sun May 15 16:33:52 EDT 2011


On Sun, May 15, 2011 at 4:21 AM, Abdul Rauf <raufbutt at gmail.com> wrote:
> Thanks for your reply. I am passing Gdk.Color.ToString() which is of the
> form rgb:ffff/0/0
> Here is a snippet:
> Gdk.Color colour1 = new Gdk.Color(255, 0, 0); //red
> Gdk.Color colour2 = new Gdk.Color(255, 255, 0); //Yellow
>         bool result = Gdk.Color.Parse("red", ref colour2);
> In this scenario, the colour2 variable changes from yellow to red and the
> function returns true. However if I passes the string as follows:
> Gdk.Color colour1 = new Gdk.Color(255, 0, 0); //red
> Gdk.Color colour2 = new Gdk.Color(255, 255, 0); //Yellow
>         bool result = Gdk.Color.Parse(colour1.ToString(), ref colour2); //
> rgb:ffff/0/0
> the colour2 variable remains yellow and the function returns false.

Oh, that's definitely odd. I would also have assumed it could be
round-tripped. What do you need to do this for?

-- 
Michael Hutchinson
http://mjhutchinson.com


More information about the Monodevelop-list mailing list