Real spectral distributions of colours are lost whenever conversion to XYZ happens, yet some tricks may produce certain correlating characteristics of a palette.

### The procedure

Given a white point `(x, y)`

in CIE xy, do the following:

- Define the illuminant
`ill`

using`(x, y)`

, according to CAT16 transform. - For each colour:
- Using
`ill`

, convert it to`CAM16UCS`

and extract chroma`C`

(in`[0; 1]`

). - In CIE xy, determine its hue angle relative to
`(x, y)`

. - Based on hue, find the nearest spectral wavelength
`w`

or determine that the colour is in the non-spectral area. If the latter is the case, ignore the colour. - Add
`w`

to the statistics with weight`C`

.

- Using
- For each wavelength in statistics, define a gaussian function with a fixed standard deviation of choice and a multiplier equal to the weight of the particular wavelength.
- Sum those gaussians and normalise the result.

### Choosing the white point

Considered options:

- Use something fixed (like D65).
- Use the centroid of the palette in CIE xy.

### Issues

Many colours could map to the non-spectral area. If they are ignored, much information concerning the palette is lost.

### Usage

Currently, probably just as a characteristic to evaluate certain aspects of the atmosphere the palette creates and compare those between palettes. Still, in pieces using the palette, distribution of colours is very flexible, which affects how the illuminant will be perceived.

### TODO

- Explore more possibilities.
- Test with palettes composed of spectral data (Pantone?).