Gdk.Color¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
blue |
r/w |
The blue component of the color |
|
green |
r/w |
The green component of the color |
|
pixel |
r/w |
For allocated colors, the pixel value used to draw this color on the screen. Not used anymore. |
|
red |
r/w |
The red component of the color. This is a value between 0 and 65535, with 65535 indicating full intensity |
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Gdk.Color(red, green, blue)¶
A
Gdk.Color
is used to describe a color, similar to the XColor struct used in the X11 drawing API.Deprecated since version 3.14: Use
Gdk.RGBA
- classmethod from_floats(red, green, blue)¶
Return a new Color object from red/green/blue values from 0.0 to 1.0.
- classmethod parse(spec)[source]¶
- Parameters:
spec (
str
) – the string specifying the color- Returns:
True
if the parsing succeeded- color:
the
Gdk.Color
to fill in
- Return type:
Parses a textual specification of a color and fill in the red, green, and blue fields of a
Gdk.Color
.The string can either one of a large set of standard names (taken from the X11
rgb.txt
file), or it can be a hexadecimal 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”).Deprecated since version 3.14: Use
Gdk.RGBA
- copy()[source]¶
- Returns:
a copy of self
- Return type:
Makes a copy of a
Gdk.Color
.The result must be freed using
Gdk.Color.free
().Deprecated since version 3.14: Use
Gdk.RGBA
- equal(colorb)[source]¶
- Parameters:
- Returns:
True
if the two colors compare equal- Return type:
Compares two colors.
Deprecated since version 3.14: Use
Gdk.RGBA
- free()[source]¶
Frees a
Gdk.Color
created withGdk.Color.copy
().Deprecated since version 3.14: Use
Gdk.RGBA
- hash()[source]¶
- Returns:
The hash function applied to self
- Return type:
A hash function suitable for using for a hash table that stores
Gdk.Colors
.Deprecated since version 3.14: Use
Gdk.RGBA
- to_floats()¶
Return (red_float, green_float, blue_float) triple.
- to_string()[source]¶
- Returns:
a newly-allocated text string
- Return type:
Returns a textual specification of self 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
().New in version 2.12.
Deprecated since version 3.14: Use
Gdk.RGBA