colour.utilities.as_float_array

colour.utilities.as_float_array(a, dtype=None)[source]

Converts given \(a\) variable to ndarray using given type.

Parameters
  • a (object) – Variable to convert.

  • dtype (object) – Type to use for conversion, default to the type defined by the colour.constant.DEFAULT_FLOAT_DTYPE attribute.

Returns

\(a\) variable converted to ndarray.

Return type

ndarray

Examples

>>> as_float_array([1, 2, 3])
array([ 1.,  2.,  3.])