OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.
import { chartColors } from '@openpanel/core/modules/report/report.constants';
export function getChartColor(index: number): string {
return chartColors[index % chartColors.length]?.main || chartColors[0].main;
}
export function getChartTranslucentColor(index: number): string {
return (
chartColors[index % chartColors.length]?.translucent ||
chartColors[0].translucent
);
}