colour.utilities.full#

colour.utilities.full(shape: int | Sequence[int], fill_value: Real, dtype: Type[DTypeReal] | None = None) NDArray[source]#

Create an array of the specified value with the active dtype.

Wrap np.full() definition to create an array with the active numpy.dtype defined by the colour.constant.DTYPE_FLOAT_DEFAULT attribute.

Parameters:
  • shape (int | Sequence[int]) – Shape of the new array, e.g., (2, 3) or 2.

  • fill_value (Real) – Fill value.

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

Returns:

Array of the specified shape and numpy.dtype, filled with the specified value.

Return type:

numpy.ndarray

Examples

>>> full(3, 2.5)
array([2.5, 2.5, 2.5])