ColoredThing#
- class blueprints.ColoredThing[source]#
Bases:
ColoredThingType,BaseThingThis class is used to implement color. The color components are stored in the
rgbaproperty. Those components are also accessible as individual propertiesred,green,blueandopacity. All components of the color array must be in the range [0, 1].Note
The transparency of
ColoredThingis modified viaopacity, and not withalpha, since this property is reserved forblueprints.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
The
Colorcontains all attributes of theColoredThingcolor components.The value is synchronized with
rgba.The values are synchronized with
rgba,red,:attr:green andblue.The values are synchronized with
rgb,red,:attr:green,blueandopacity.Attributes Documentation
- blue#
The value is synchronized with
rgbandrgba.- Returns:
The blue component of the color array.
- Return type:
float | None
- color#
The
Colorcontains all attributes of theColoredThingcolor components.- Return type:
- green#
The value is synchronized with
rgbandrgba.- 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
rgbandrgba.- Returns:
The red component of the color array.
- Return type:
float | None
- rgb#
The values are synchronized with
rgba,red,:attr:green andblue.- Returns:
The color array without opacity.
- Return type:
np.ndarray
- rgba#
The values are synchronized with
rgb,red,:attr:green,blueandopacity.- 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)#