colour.utilities.ones#

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

Create an array of ones with the active dtype.

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

Parameters:
Returns:

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

Return type:

numpy.ndarray

Examples

>>> ones(3)
array([1., 1., 1.])