colour.utilities.xp_as_int_array#

colour.utilities.xp_as_int_array(a: ArrayLike, *, xp: ProtocolArrayNamespace | ModuleType | None = None, like: Any = None) NDArrayInt[source]#

Convert the specified variable \(a\) to an integer array in the target namespace using colour.constants.DTYPE_INT_DEFAULT.

Shorthand for xp_as_array(a, dtype=DTYPE_INT_DEFAULT, xp=xp, like=like).

Parameters:
Returns:

Variable \(a\) as an integer array in the target namespace.

Return type:

object

Examples

>>> xp_as_int_array([1.5, 2.7, 3.9], xp=np)
array([1, 2, 3])