colour.utilities.as_float_scalar#

colour.utilities.as_float_scalar(a: ArrayLike, dtype: Type[DTypeFloat] | None = None) float[source]#

Convert given \(a\) variable to numpy.floating using given numpy.dtype.

Parameters:
  • a (ArrayLike) – Variable \(a\) to convert.

  • dtype (Type[DTypeFloat] | None) – numpy.dtype to use for conversion, default to the numpy.dtype defined by the colour.constant.DTYPE_FLOAT_DEFAULT attribute.

Returns:

\(a\) variable converted to numpy.floating.

Return type:

float

Warning

Examples

>>> as_float_scalar(np.array(1))
1.0