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 given numpy.dtype.

Parameters:
  • a (ArrayLike) – Variable \(a\) to convert.

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

Returns:

\(a\) variable converted to numpy.integer.

Return type:

int

Warning

Examples

>>> as_int_scalar(np.array(1))
1