Color

A GdkColor represents a color.

When working with cairo, it is often more convenient to use a GdkRGBA instead.

Constructors

this
this(GdkColor* gdkColor)

Sets our main struct and passes it to the parent class

this
this()
this(ubyte red, ubyte green, ubyte blue)
this(ushort red, ushort green, ushort blue)

Creates a new Color

Destructor

~this
~this()
Undocumented in source.

Members

Functions

blue
ushort blue()
void blue(ushort value)

The color values.

copy
Color copy()

Makes a copy of a color structure. The result must be freed using gdk_color_free().

equal
int equal(Color colorb)

Compares two colors.

free
void free()

Frees a color structure created with gdk_color_copy().

getColorStruct
GdkColor* getColorStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

green
ushort green()
void green(ushort value)

The color values.

hash
uint hash()

A hash function suitable for using for a hash table that stores GdkColors.

pixel
uint pixel()

The color values.

red
ushort red()
void red(ushort value)

The color values.

toString
string toString()

Returns a textual specification of color in the hexadecimal form #rrrrggggbbbb, where r, g and b are hex digits representing the red, green and blue components respectively. The returned string can be parsed by gdk_color_parse(). Since 2.12

Static functions

parse
int parse(string spec, Color color)

Parses a textual specification of a color and fill in the red, green, and blue fields of a GdkColor structure. The string can either one of a large set of standard names (taken from the X11 rgb.txt file), or it can be a hex value in the form '#rgb' '#rrggbb' '#rrrgggbbb' or '#rrrrggggbbbb' where 'r', 'g' and 'b' are hex digits of the red, green, and blue components of the color, respectively. (White in the four forms is '#fff', '#ffffff', '#fffffffff' and '#ffffffffffff').

Variables

gdkColor
GdkColor* gdkColor;

the main Gtk struct

Meta