2003-02-12 01:57:20 +00:00
<Type Name= "Color" FullName= "Gdk.Color" >
2003-02-15 03:08:25 +00:00
<TypeSignature Language= "C#" Value= "public sealed struct Color;" Maintainer= "auto" />
2003-02-12 01:57:20 +00:00
<AssemblyInfo >
<AssemblyName > gdk-sharp</AssemblyName>
<AssemblyVersion > 0.0.0.0</AssemblyVersion>
<Attributes />
</AssemblyInfo>
2003-02-23 07:26:30 +00:00
<ThreadSafetyStatement > Gtk# is thread aware, but not thread safe; See the <link location= "node:gtk-sharp/programming/threads" > Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
2003-02-12 01:57:20 +00:00
<Docs >
2003-02-28 20:45:23 +00:00
<summary > Describes an allocated or unallocated color.</summary>
<remarks >
<para >
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
2003-03-07 01:30:00 +00:00
allocated using the <see cref= "M:Gdk.Colormap.AllocColor(Gdk.Color,bool,bool)" />
method. After a color is allocated the value in the <see cref= "F:Gdk.Color.pixel" /> field is valid.
2003-02-28 20:45:23 +00:00
</para>
<example >
2003-03-07 01:30:00 +00:00
<code lang= "C#" >
2003-02-28 20:45:23 +00:00
DrawRedLine (Gdk.Drawable drawable)
{
2003-04-12 20:44:26 +00:00
Gdk.GC gc = new Gdk.GC (drawable);
2003-02-28 20:45:23 +00:00
2003-04-12 20:44:26 +00:00
Gdk.Color red_color = new Gdk.Color (0xff, 0, 0);
2003-02-28 20:45:23 +00:00
2003-04-12 20:44:26 +00:00
// Use the system colormap, easy.
Gdk.Colormap colormap = Gdk.Colormap.System;
colormap.AllocColor (red_color, true, true);
gc.Foreground = red_color;
2003-02-28 20:45:23 +00:00
2003-04-12 20:44:26 +00:00
// Now you can use it
drawable.DrawLine (gc, 0, 0, 100, 100);
2003-02-28 20:45:23 +00:00
}
</code>
</example>
</remarks>
2003-02-12 01:57:20 +00:00
</Docs>
<Base >
<BaseTypeName > System.ValueType</BaseTypeName>
</Base>
<Interfaces />
<Attributes />
<Members >
<Member MemberName= "Zero" >
<MemberSignature Language= "C#" Value= "public static Gdk.Color Zero;" />
<MemberType > Field</MemberType>
<ReturnValue >
<ReturnType > Gdk.Color</ReturnType>
</ReturnValue>
<Parameters />
<Docs >
2003-02-28 20:51:45 +00:00
<summary > Unallocated, empty color.</summary>
2003-03-07 01:30:00 +00:00
<remarks />
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
<Member MemberName= "pixel" >
<MemberSignature Language= "C#" Value= "public uint pixel;" />
<MemberType > Field</MemberType>
<ReturnValue >
<ReturnType > System.UInt32</ReturnType>
</ReturnValue>
<Parameters />
<Docs >
2003-02-28 20:45:23 +00:00
<summary > Pixel value for the color</summary>
<remarks >
2003-03-07 01:30:00 +00:00
<para >
2003-02-28 20:45:23 +00:00
Colors are specified in Gdk by their red, green and blue
elements. But before the color can be used, the color
has to be allocated in a given colormap. The value of the
allocation is stored in this pixel field and it is the
token used to render the color.
</para>
2003-03-07 01:30:00 +00:00
<para >
The pixel value is initialized when using the <see cref= "M:Gdk.Colormap.AllocColor(Gdk.Color,bool,bool)" /> method.
2003-02-28 20:45:23 +00:00
</para>
2003-03-07 01:30:00 +00:00
</remarks>
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
<Member MemberName= "red" >
<MemberSignature Language= "C#" Value= "public ushort red;" />
<MemberType > Field</MemberType>
<ReturnValue >
<ReturnType > System.UInt16</ReturnType>
</ReturnValue>
<Parameters />
<Docs >
2003-02-28 20:45:23 +00:00
<summary > Red element of the color</summary>
2003-03-07 01:30:00 +00:00
<remarks />
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
<Member MemberName= "green" >
<MemberSignature Language= "C#" Value= "public ushort green;" />
<MemberType > Field</MemberType>
<ReturnValue >
<ReturnType > System.UInt16</ReturnType>
</ReturnValue>
<Parameters />
<Docs >
2003-02-28 20:45:23 +00:00
<summary > Green element of the color</summary>
2003-03-07 01:30:00 +00:00
<remarks />
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
<Member MemberName= "blue" >
<MemberSignature Language= "C#" Value= "public ushort blue;" />
<MemberType > Field</MemberType>
<ReturnValue >
<ReturnType > System.UInt16</ReturnType>
</ReturnValue>
<Parameters />
<Docs >
2003-02-28 20:45:23 +00:00
<summary > Blue element of the color.</summary>
2003-03-07 01:30:00 +00:00
<remarks />
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
2003-02-28 07:10:53 +00:00
<Member MemberName= ".ctor" >
<MemberSignature Language= "C#" Value= "public Color (byte r, byte g, byte b);" />
<MemberType > Constructor</MemberType>
<ReturnValue />
<Parameters >
2003-07-21 00:13:00 +00:00
<Parameter Name= "r" Type= "System.Byte" />
<Parameter Name= "g" Type= "System.Byte" />
<Parameter Name= "b" Type= "System.Byte" />
</Parameters>
2003-02-28 07:10:53 +00:00
<Docs >
<summary > Color constructor from RGB byte values</summary>
<param name= "r" > Red value (0-255)</param>
<param name= "g" > Green value (0-255)</param>
<param name= "b" > Blue value (0-255)</param>
<returns > The constructed color structure</returns>
<remarks >
<para >
This constructs the color from three byte values for red,
green and blue. Notice that the Gdk.Color structure
actually uses 16-bit color values, so the byte values are
mapped into the 16-bit value space. This is just a
convenience routine to initialize this structure.
</para>
2003-03-07 01:30:00 +00:00
<para >
2003-02-28 20:45:23 +00:00
To use the Gdk.Color you must allocate it within the
current colormap.
</para>
2003-03-07 01:30:00 +00:00
<example >
<code lang= "C#" >
2003-02-28 20:45:23 +00:00
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);
// Now you can use it
drawable.DrawLine (gc, 0, 0, 100, 100);
}
</code>
2003-03-07 01:30:00 +00:00
</example>
2003-02-28 07:10:53 +00:00
</remarks>
</Docs>
</Member>
2003-02-12 01:57:20 +00:00
<Member MemberName= "Parse" >
2003-03-15 22:58:57 +00:00
<MemberSignature Language= "C#" Value= "public static bool Parse (string spec, ref Gdk.Color color);" />
2003-02-12 01:57:20 +00:00
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > System.Int32</ReturnType>
</ReturnValue>
<Parameters >
2003-07-21 00:13:00 +00:00
<Parameter Name= "spec" Type= "System.String" />
<Parameter Name= "color" Type= "Gdk.Color&" RefType= "ref" />
</Parameters>
2003-02-12 01:57:20 +00:00
<Docs >
2003-02-28 20:51:45 +00:00
<summary > Parses a textual color representation</summary>
2003-02-28 20:45:23 +00:00
<param name= "spec" > A string specification for the color.</param>
<param name= "color" > A structure where the colors are generated</param>
<returns > Non-zero on success</returns>
<remarks >
2003-03-07 01:30:00 +00:00
<para >
2003-02-28 20:45:23 +00:00
Parses a textual specification of a color and fill in the
red, green, and blue fields of the Gdk.Color structure.
2003-03-07 01:30:00 +00:00
The color is not allocated, you must call <see cref= "M:Gdk.Colormap.AllocColor(Gdk.Color,bool,bool)" />
2003-02-28 20:45:23 +00:00
yourself.
</para>
2003-03-07 01:30:00 +00:00
<para >
2003-02-28 20:45:23 +00:00
The text string can be in any of the forms accepted by
XParseColor; these include name for a color from rgb.txt,
such as DarkSlateGray, or a hex specification such as
305050.
</para>
2003-03-07 01:30:00 +00:00
<example >
<code lang= "C#" >
2003-02-28 20:45:23 +00:00
DrawRedLine (Gdk.Drawable drawable)
{
Gdk.GC gc = new Gdk.GC (drawable);
Gdk.Color red_color;
Gdk.Color.Parse ("red", ref red_color);
// Use the system colormap, easy.
Gdk.Colormap colormap = Gdk.Colormap.System;
colormap.AllocColor (red_color, true, true);
// Now you can use it
drawable.DrawLine (gc, 0, 0, 100, 100);
}
</code>
2003-03-07 01:30:00 +00:00
</example>
</remarks>
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
<Member MemberName= "New" >
<MemberSignature Language= "C#" Value= "public static Gdk.Color New (IntPtr raw);" />
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > Gdk.Color</ReturnType>
</ReturnValue>
<Parameters >
2003-07-21 00:13:00 +00:00
<Parameter Name= "raw" Type= "System.IntPtr" />
</Parameters>
2003-02-12 01:57:20 +00:00
<Docs >
2003-04-12 20:44:26 +00:00
<summary > Creates a color from an unmanaged location.</summary>
<param name= "raw" > A pointer to the unmanaged GdkColor structure.</param>
<returns > This returns a Gdk.Color structure.</returns>
<remarks >
2003-07-17 06:38:40 +00:00
<para >
The <paramref name= "raw" /> parameter points to a C-based
2003-04-12 20:44:26 +00:00
GdkColor structure. This routine creates a Gdk.Color
structure from its unmanaged version.
</para>
2003-07-17 06:38:40 +00:00
</remarks>
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
<Member MemberName= "ToString" >
<MemberSignature Language= "C#" Value= "public virtual string ToString ();" />
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs >
2003-02-28 20:51:45 +00:00
<summary > The color value as a string.</summary>
<returns > The color value as a string.</returns>
2003-03-07 01:30:00 +00:00
<remarks />
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
<Member MemberName= "Equal" >
<MemberSignature Language= "C#" Value= "public bool Equal (Gdk.Color colorb);" />
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > System.Boolean</ReturnType>
</ReturnValue>
<Parameters >
2003-07-21 00:13:00 +00:00
<Parameter Name= "colorb" Type= "Gdk.Color" />
</Parameters>
2003-02-12 01:57:20 +00:00
<Docs >
2003-02-28 20:51:45 +00:00
<summary > Compares whether two colors are equal.</summary>
<param name= "colorb" > The color to compare</param>
<returns > true if the red, green and blue components are the same</returns>
<remarks >
2003-03-07 01:30:00 +00:00
<para >
Notice that this will not compare the <see cref= "F:Gdk.Color.pixel" /> value, it will
2003-02-28 20:51:45 +00:00
only compare the red, green and blue elements.
</para>
2003-03-07 01:30:00 +00:00
</remarks>
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
2003-07-17 06:38:40 +00:00
<Member MemberName= "GType" >
<MemberSignature Language= "C#" Value= "public static uint GType { get; };" />
<MemberType > Property</MemberType>
2003-02-12 01:57:20 +00:00
<ReturnValue >
2003-07-17 06:38:40 +00:00
<ReturnType > System.UInt32</ReturnType>
2003-02-12 01:57:20 +00:00
</ReturnValue>
<Docs >
2003-07-17 06:38:40 +00:00
<summary > The GLib Type for Gdk.Color</summary>
<returns > The GLib Type for the Gdk.Color class.</returns>
<remarks />
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
2003-07-17 06:38:40 +00:00
<Member MemberName= "GetHashCode" >
<MemberSignature Language= "C#" Value= "public virtual int GetHashCode ();" />
2003-02-12 01:57:20 +00:00
<MemberType > Method</MemberType>
<ReturnValue >
2003-07-17 06:38:40 +00:00
<ReturnType > System.Int32</ReturnType>
2003-02-12 01:57:20 +00:00
</ReturnValue>
<Parameters />
<Docs >
2003-04-12 20:44:26 +00:00
<summary > A hash function suitable for using for a hash table
2003-07-18 02:50:06 +00:00
that stores <see cref= "T:Gdk.Color" /> objects.</summary>
2003-04-12 20:44:26 +00:00
<returns > The hash code.</returns>
2003-07-17 06:38:40 +00:00
<remarks > To be added</remarks>
2003-02-12 01:57:20 +00:00
</Docs>
</Member>
2003-03-07 01:30:00 +00:00
<Member MemberName= ".ctor" >
2003-07-17 06:38:40 +00:00
<MemberSignature Language= "C#" Value= "public Color (System.Drawing.Color color);" />
2003-03-07 01:30:00 +00:00
<MemberType > Constructor</MemberType>
<ReturnValue />
<Parameters >
2003-07-21 00:13:00 +00:00
<Parameter Name= "color" Type= "System.Drawing.Color" />
</Parameters>
2003-03-07 01:30:00 +00:00
<Docs >
2003-04-12 20:44:26 +00:00
<summary > Color constructor from a System.Drawing.Color.</summary>
2003-07-18 02:50:06 +00:00
<param name= "color" > The <see cref= "T:System.Drawing.Color" /> object.</param>
2003-04-12 20:44:26 +00:00
<returns > The constructed color structure from the
System.Drawing.Color definition.</returns>
2003-07-18 02:50:06 +00:00
<remarks >
2003-04-12 20:44:26 +00:00
<para >
This constructs the color from the specified
System.Drawing.Color object. Notice that the Gdk.Color
structure actually uses 16-bit color values, so the byte
values are mapped into the 16-bit value space. This is
just a convenience routine to initialize this structure.
</para>
<para >
To use the Gdk.Color you must allocate it within the
current colormap.
</para>
<example >
<code lang= "C#" >
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);
// Now you can use it
drawable.DrawLine (gc, 0, 0, 100, 100);
}
</code>
</example>
</remarks>
2003-03-07 01:30:00 +00:00
</Docs>
</Member>
2003-02-12 01:57:20 +00:00
</Members>
2003-07-21 00:13:00 +00:00
</Type>