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