Color

A gdk.Color is used to describe a color, similar to the XColor struct used in the X11 drawing API.

More...

Constructors

this
this(GdkColor* gdkColor, bool ownedRef)

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

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

copy
Color copy()

Makes a copy of a gdk.Color

equal
bool equal(Color colorb)

Compares two colors.

free
void free()

Frees a gdk.Color created with Color.copy.

getColorStruct
GdkColor* getColorStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

hash
uint hash()

A hash function suitable for using for a hash table that stores gdk.Colors

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.

Properties

blue
ushort blue [@property getter]
ushort blue [@property setter]

The blue component of the color

green
ushort green [@property getter]
ushort green [@property setter]

The green component of the color

pixel
uint pixel [@property getter]
uint pixel [@property setter]

For allocated colors, the pixel value used to draw this color on the screen. Not used anymore.

red
ushort red [@property getter]
ushort red [@property setter]

The red component of the color. This is a value between 0 and 65535, with 65535 indicating full intensity

Static functions

getType
GType getType()
parse
bool parse(string spec, Color color)

Parses a textual specification of a color and fill in the red, green, and blue fields of a gdk.Color

Variables

gdkColor
GdkColor* gdkColor;

the main Gtk struct

Detailed Description

Deprecated: Use gdk.RGBA