colour.utilities.format_array_as_row#

colour.utilities.format_array_as_row(a: ArrayLike, decimals: int = 7, separator: str = ' ') str[source]#

Format given array \(a\) as a row.

Parameters:
  • a (ArrayLike) – Array to format.

  • decimals (int) – Decimal count to use when formatting as a row.

  • separator (str) – Separator used to join the array \(a\) items.

Returns:

Array formatted as a row.

Return type:

str

Examples

>>> format_array_as_row([1.25, 2.5, 3.75])
'1.2500000 2.5000000 3.7500000'
>>> format_array_as_row([1.25, 2.5, 3.75], 3)
'1.250 2.500 3.750'
>>> format_array_as_row([1.25, 2.5, 3.75], 3, ", ")
'1.250, 2.500, 3.750'