colour.utilities.as_int_scalar#
- colour.utilities.as_int_scalar(a: ArrayLike, dtype: Type[DTypeInt] | None = None) int[source]#
Convert the specified variable \(a\) to
numpy.integerusing the specifiednumpy.dtype.- Parameters:
a (ArrayLike) – Variable \(a\) to convert.
dtype (Type[DTypeInt] | None) –
numpy.dtypeto use for conversion, default to thenumpy.dtypedefined by thecolour.constant.DTYPE_INT_DEFAULTattribute.
- Returns:
Variable \(a\) converted to
numpy.integer.- Return type:
Warning
The return type is effectively annotated as
intand notnumpy.integer.
Examples
>>> as_int_scalar(np.array(1)) 1