colour.utilities.xp_as_float_array#

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

Convert the specified variable \(a\) to a float array in the target namespace using colour.constants.DTYPE_FLOAT_DEFAULT.

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

Parameters:
Returns:

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

Return type:

object

Examples

>>> xp_as_float_array([1, 2, 3], xp=np)
array([1., 2., 3.])