colour.utilities.MixinDataclassArray#

class colour.utilities.MixinDataclassArray[source]#

Bases: MixinDataclassIterable

A mixin providing conversion methods for dataclass-like class conversion to numpy.ndarray class.

Methods

Notes

__array__(dtype: Type[DTypeReal] | None = None) ndarray[Any, dtype[_ScalarType_co]][source]#

Implement support for dataclass-like class conversion to numpy.ndarray class.

A field set to None will be filled with np.nan according to the shape of the first field not set with None.

Parameters:

dtype (Type[DTypeReal] | None) – numpy.dtype to use for conversion to np.ndarray, default to the numpy.dtype defined by colour.constant.DTYPE_FLOAT_DEFAULT attribute.

Returns:

dataclass-like class converted to numpy.ndarray.

Return type:

numpy.ndarray