ColoredThing#

class blueprints.ColoredThing[source]#

Bases: ColoredThingType, BaseThing

This class is used to implement color. The color components are stored in the rgba property. Those components are also accessible as individual properties red, green, blue and opacity. All components of the color array must be in the range [0, 1].

Note

The transparency of ColoredThing is modified via opacity, and not with alpha, since this property is reserved for blueprints.thing.moveable.MoveableThing.alpha!

Parameters:
  • rgb (list[int | float] | np.ndarray | None, optional) – The color array without opacity.

  • rgba (list[int | float] | np.ndarray | None, optional) – The color array with opacity.

  • **kwargs – Keyward arguments are passed to super().__init__.

Attributes Summary

blue

The value is synchronized with rgb and rgba.

color

The Color contains all attributes of the ColoredThing color components.

green

The value is synchronized with rgb and rgba.

opacity

The value is synchronized with rgba.

red

The value is synchronized with rgb and rgba.

rgb

The values are synchronized with rgba, red,:attr:green and blue .

rgba

The values are synchronized with rgb, red,:attr:green, blue and opacity.

Attributes Documentation

blue#

The value is synchronized with rgb and rgba.

Returns:

The blue component of the color array.

Return type:

float | None

color#

The Color contains all attributes of the ColoredThing color components.

Return type:

Color

green#

The value is synchronized with rgb and rgba.

Returns:

The green component of the color array.

Return type:

float | None

opacity#

The value is synchronized with rgba.

Returns:

The opacity component of the color array.

Return type:

int | float

red#

The value is synchronized with rgb and rgba.

Returns:

The red component of the color array.

Return type:

float | None

rgb#

The values are synchronized with rgba, red,:attr:green and blue .

Returns:

The color array without opacity.

Return type:

np.ndarray

rgba#

The values are synchronized with rgb, red,:attr:green, blue and opacity.

Returns:

The color array with opacity.

Return type:

np.ndarray

__init__(color='white', opacity=None, **kwargs)[source]#
Parameters:
  • rgb (list[int | float] | np.ndarray | None, optional) – The color array without opacity.

  • rgba (list[int | float] | np.ndarray | None, optional) – The color array with opacity.

  • **kwargs – Keyward arguments are passed to super().__init__.

classmethod __new__(*args, **kwargs)#