colour.utilities.closest_indexes#

colour.utilities.closest_indexes(a: ArrayLike, b: ArrayLike) ndarray[source]#

Return the array \(a\) closest element indexes to the reference array \(b\) elements.

Parameters:
  • a (ArrayLike) – Array \(a\) to search for the closest element indexes.

  • b (ArrayLike) – Reference array \(b\).

Returns:

Closest array \(a\) element indexes.

Return type:

numpy.ndarray

Examples

>>> a = np.array([24.31357115, 63.62396289, 55.71528816,
...               62.70988028, 46.84480573, 25.40026416])
>>> print(closest_indexes(a, 63))
[3]
>>> print(closest_indexes(a, [63, 25]))
[3 5]