colour.utilities.as_float_array#
- colour.utilities.as_float_array(a: ArrayLike, dtype: Type[DTypeFloat] | None = None) NDArrayFloat[source]#
Convert the specified variable \(a\) to
numpy.ndarrayusing the specified floating-pointnumpy.dtype.- Parameters:
a (ArrayLike) – Variable \(a\) to convert.
dtype (Type[DTypeFloat] | None) – Floating-point
numpy.dtypeto use for conversion, default to thenumpy.dtypedefined by thecolour.constant.DTYPE_FLOAT_DEFAULTattribute.
- Returns:
Variable \(a\) converted to floating-point
numpy.ndarray.- Return type:
Examples
>>> as_float_array([1, 2, 3]) array([1., 2., 3.])