colour.utilities.as_int_scalar#

colour.utilities.as_int_scalar(a: NumberOrArrayLike, dtype: Type[DTypeInteger] | None = None) int[source]#

Convert given \(a\) variable to numpy.integer using given numpy.dtype.

Parameters:
  • a (NumberOrArrayLike) – Variable to convert.

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

Returns:

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

Return type:

numpy.integer

Examples

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