colour.utilities.as_int_scalar#
- colour.utilities.as_int_scalar(a: ArrayLike, dtype: Type[DTypeInt] | None = None) int [source]#
Convert given \(a\) variable to
numpy.integer
using givennumpy.dtype
.- Parameters:
a (ArrayLike) – Variable \(a\) to convert.
dtype (Type[DTypeInt] | None) –
numpy.dtype
to use for conversion, default to thenumpy.dtype
defined by thecolour.constant.DTYPE_INT_DEFAULT
attribute.
- Returns:
\(a\) variable converted to
numpy.integer
.- Return type:
Warning
The return type is effectively annotated as
int
and notnumpy.integer
.
Examples
>>> as_int_scalar(np.array(1)) 1