The documentation doesn't help either - it's nasty generated stuff that simply enumerates the API interfaces without adding very much useful information.
For example, https://api.anychart.com/7.11.1/anychart.palettes.DistinctCo... - why would you want to attach listeners to palette colors? There might be a great reason, or those methods might just have been inherited from the base class, but the documentation is no to your understanding help whatsoever. The example is for the base class rather than the palette object.
This is actually a good example of bad documentation.