Creates an instance of ColorPalette and attaches it to a diagram model. The ColorPalettte will be based on colors used in the given Diagram.
The diagram model to read colors from.
List colors in descending order of their frequency.
An array of color strings sorted by their usage frequency.
Refreshes the color palette by scanning the diagram for all colors currently in use.
This method should be called whenever there are changes to the diagram that may affect color usage.
It updates the internal count of colors used in the diagram, which can then be retrieved using frequentColors().
Manually adds a color to the palette's tracking. This can be used to populate the palette with known colors.
The color string to add to the palette.
A class that manages colors frequently used in a diagram. It can be used to support building adaptive editor UIs.