Gdk.Color Structure
Describes an allocated or unallocated color.

See Also: Color Members

Syntax

public struct Color

Remarks

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);
	  }
	

Requirements

Namespace: Gdk
Assembly: gdk-sharp (in gdk-sharp.dll)
Assembly Versions: 2.12.0.0