Image Palette
The colours of an image as a bar, each as wide as its share of the picture. Change the count and colours split off or merge smoothly instead of reshuffling.
Needs: None. Clustering runs in the page on a small copy of the image, which must be same-origin or CORS-enabled.
Customize
photo
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| src | string | required | The image. Its pixels are read through a canvas, so it must be same-origin or CORS-enabled. |
| alt | string | "" | Describes the image. |
| colours | number | 5 | How many colours, 2 to 8. The stepper changes it from there; a new value here refits. |
| onPalette | (colours: { hex: string; share: number }[]) => void | – | Called with the palette, most used first, each time it's fitted. |
| className | string | – | Class on the wrapper. |
| style | CSSProperties | – | Style on the wrapper, e.g. --mlui-radius. |