Colord.ColorRGB

Fields

Name

Type

Access

Description

B

float

r/w

G

float

r/w

R

float

r/w

Methods

class

array_interpolate (array, new_length)

class

array_is_monotonic (array)

class

array_new ()

class

new ()

copy (dest)

dup ()

free ()

from_wavelength (wavelength)

interpolate (p2, index, result)

set (R, G, B)

to_rgb8 (dest)

Details

class Colord.ColorRGB
classmethod array_interpolate(array, new_length)[source]
Parameters:
  • array ([Colord.ColorRGB]) – Input array

  • new_length (int) – the target length of the return array

Returns:

An array of size new_length or None

Return type:

[Colord.ColorRGB]

Interpolate the RGB array to a different size. This uses the Akima interpolation algorithm unless the array would become non-monotonic, in which case it falls back to linear interpolation.

New in version 0.1.31.

classmethod array_is_monotonic(array)[source]
Parameters:

array ([Colord.ColorRGB]) – Input array

Returns:

True if the array is monotonic

Return type:

bool

Checks the array for monotonicity.

New in version 0.1.31.

classmethod array_new()[source]
Returns:

New array

Return type:

[Colord.ColorRGB]

Creates a new RGB array.

New in version 0.1.31.

classmethod new()[source]
Returns:

A newly allocated Colord.ColorRGB object

Return type:

Colord.ColorRGB

Allocates a color value.

New in version 0.1.0.

copy(dest)[source]
Parameters:

dest (Colord.ColorRGB) – the destination color

Deep copies a color value.

New in version 0.1.27.

dup()[source]
Return type:

Colord.ColorRGB

New in version 0.1.27.

free()[source]

Deallocates a color value.

New in version 0.1.0.

from_wavelength(wavelength)[source]
Parameters:

wavelength (float) – the wavelength roughly between 380nm and 780nm

Set an RGB color which is roughly representative to the wavelength.

New in version 1.3.4.

interpolate(p2, index, result)[source]
Parameters:

New in version 0.1.26.

set(R, G, B)[source]
Parameters:
  • R (float) – component value

  • G (float) – component value

  • B (float) – component value

Initialises a color value.

New in version 0.1.27.

to_rgb8(dest)[source]
Parameters:

dest (Colord.ColorRGB8) – the destination color

Convert from one color format to another.

New in version 0.1.27.