### Definition

One of reasons a palette is of limited usability is that it has colours that are too similar in context of their structure. In particular, it means that there is some pair of colours such that the colour distance between them is much smaller than the mean distance between colours in the palette.

I suggest a metric that would allow detecting such cases with computation.

Suppose we have a colour distance function `d`

. For a palette of size `n>=2`

, `mean_d`

and `min_d`

would be mean and minimal pairwise colour distances. Then Internal Similarity Score is defined the following way:

`ISS := (mean_d/min_d) / n^(2/3)`

### Explanation

While the `mean_d/min_d`

is the part one wants to keep limited, we need to keep in mind that with greater number of colours there is the same volume to position them, and `min_d`

will be systematically lower while `mean_d`

suitable for art would be quite stable. To compensate this effect, the ratio is multiplied by a rough estimate of expected minimal pairwise distance between `n`

random points in a unit cube, which also gives a reasonable asymptotic estimate for non-cubical perceptual colour spaces.

If `mean_d = min_d`

, `ISS = 1/n^(2/3)`

. It will also be the case for `n=2`

.

If all the colours are multiplied by a non-zero constant, `ISS`

is intact.

### Choice of distance function

It is desirable to choose a colour distance function that would reflect perception well.

Tests were made with CAM16 Jab and basic euclidean RGB distances. While their outputs generally correlated, there were many palettes that had considerably different ISS.

The results also looked much more stable with CAM16, but are also ~acceptable with RGB.

### Data

Two data sources were tested. One is a dump of Lospec moderated palette database (labelled as `all`

) and the other is https://sites.google.com/view/rejected-palettes/palette-list (labelled as `rejected`

), which contains a mix of rejected and accepted Lospec palettes that seemed poor to moderators of `rejected`

. A few number of palettes with extreme values were omitted in some graphs to make them legible.

ISS comparison shows that many of `rejected`

palettes have considarably higher ISS values:

Typical ISS-CAM16 values for palettes from `all`

range from 0.4 to 1.9.