See Also: Color Members
The Gdk.Color structure is used to describe an allocated or unallocated color. Unallocated colors only have the red, green and blue ushort values initialized. Colors are allocated using the Colormap.AllocColor(Color, bool, bool) method. After a color is allocated the value in the Color.pixel field is valid.
C# Example
DrawRedLine (Gdk.Drawable drawable) { Gdk.GC gc = new Gdk.GC (drawable); Gdk.Color red_color = new Gdk.Color (0xff, 0, 0); // Use the system colormap, easy. Gdk.Colormap colormap = Gdk.Colormap.System; colormap.AllocColor (red_color, true, true); gc.Foreground = red_color; // Now you can use it drawable.DrawLine (gc, 0, 0, 100, 100); }