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