embcol.color.pairwise_color_diffs

embcol.color.pairwise_color_diffs(oklabs, *, squared=False)[source]

Measure color differences among a set of colors.

Parameters:
  • oklabs (array-like of float) – Set of Oklab colors. The shape must be (N, 3), where N is the number of colors.

  • squared (bool, optional) – If True is given, squared values are returned.

Returns:

numpy.ndarray of float – Color differences. If squared is True, values are squared color differences instead. The shape is ((N-1)*N//2,): only off-diagonal elements above the main diagonal of a distance matrix is returned. Items are in row-major order.