Gegl.Color

g GObject.Object GObject.Object Gegl.Color Gegl.Color GObject.Object->Gegl.Color

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (string)

duplicate ()

get_bytes (format)

get_cmyk (space)

get_components (format)

get_format ()

get_rgba ()

get_rgba_with_space (space)

set_bytes (format, bytes)

set_cmyk (cyan, magenta, yellow, key, alpha, space)

set_components (format, components)

set_rgba (red, green, blue, alpha)

set_rgba_with_space (red, green, blue, alpha, space)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

string

str

r/w

A String representation of the Gegl.Color

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Gegl.Color(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gegl.ColorClass

classmethod new(string)
Parameters:

string (str) – a string describing the color to be created.

Return type:

Gegl.Color

Creates a new Gegl.Color.

Returns the newly created Gegl.Color.

duplicate()
Returns:

A new copy of self.

Return type:

Gegl.Color

Creates a copy of self.

get_bytes(format)
Parameters:

format (Babl.Object) – a babl pixel format

Returns:

the color in the given format.

Return type:

GLib.Bytes

get_cmyk(space)
Parameters:

space (Babl.Object or None) – CMYK space.

Returns:

cyan:

cyan return location.

magenta:

magenta return location.

yellow:

yellow return location.

key:

key return location.

alpha:

alpha return location.

Return type:

(cyan: float, magenta: float, yellow: float, key: float, alpha: float)

Retrieves the current set color stored as space. If space is None, this is equivalent to requesting color in the default naive CMYK space.

get_components(format)
Parameters:

format (GObject.Value) – A Babl.Object pointer

Returns:

The color components If value format not supported return None and components_length set to 0.

Return type:

[float]

Get the component values of the color in format.

get_format()
Returns:

the pixel format encoding of the set color.

Return type:

Babl.Object

get_rgba()
Returns:

red:

red return location.

green:

green return location.

blue:

blue return location.

alpha:

alpha return location.

Return type:

(red: float, green: float, blue: float, alpha: float)

Retrieves the current set color as linear light non premultipled RGBA data, any of the return pointers can be omitted.

get_rgba_with_space(space)
Parameters:

space (Babl.Object) – RGB space.

Returns:

red:

red return location.

green:

green return location.

blue:

blue return location.

alpha:

alpha return location.

Return type:

(red: float, green: float, blue: float, alpha: float)

Retrieves the current set color stored as space. If space is None, this is equivalent to requesting color in sRGB.

set_bytes(format, bytes)
Parameters:

Set a Gegl.Color from a pixel stored in a GLib.Bytes and it’s babl format.

set_cmyk(cyan, magenta, yellow, key, alpha, space)
Parameters:

Set color as CMYK data stored as space. If space is None, this is equivalent to storing with the default naive CMYK space.

set_components(format, components)
Parameters:

Set the color using the component values as format.

set_rgba(red, green, blue, alpha)
Parameters:
  • red (float) – red value

  • green (float) – green value

  • blue (float) – blue value

  • alpha (float) – alpha value

Set color as linear light non premultipled RGBA data

set_rgba_with_space(red, green, blue, alpha, space)
Parameters:

Set color as RGBA data stored as space. If space is None, this is equivalent to storing as sRGB.

Property Details

Gegl.Color.props.string
Name:

string

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE

A String representation of the Gegl.Color