colour.utilities.as_int_array#
- colour.utilities.as_int_array(a: NumberOrArrayLike, dtype: Type[DTypeInteger] | None = None) ndarray [source]#
Convert given variable \(a\) to
numpy.ndarray
using givennumpy.dtype
.- Parameters:
a (NumberOrArrayLike) – Variable to convert.
dtype (Type[DTypeInteger] | None) –
numpy.dtype
to use for conversion, default to thenumpy.dtype
defined by thecolour.constant.DEFAULT_INT_DTYPE
attribute.
- Returns:
Variable \(a\) converted to
numpy.ndarray
.- Return type:
Examples
>>> as_int_array([1.0, 2.0, 3.0]) array([1, 2, 3]...)