diff --git a/packages/frontend/src/components/MkActiveUsersHeatmap.vue b/packages/frontend/src/components/MkActiveUsersHeatmap.vue index 9204c7312a..6b89a012f2 100644 --- a/packages/frontend/src/components/MkActiveUsersHeatmap.vue +++ b/packages/frontend/src/components/MkActiveUsersHeatmap.vue @@ -34,6 +34,7 @@ import { defaultStore } from '@/store'; import { useChartTooltip } from '@/scripts/use-chart-tooltip'; import { MatrixController, MatrixElement } from 'chartjs-chart-matrix'; import { chartVLine } from '@/scripts/chart-vline'; +import { alpha } from '@/scripts/color'; Chart.register( ArcElement, @@ -53,14 +54,6 @@ Chart.register( MatrixController, MatrixElement, ); -const alpha = (hex, a) => { - const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex)!; - const r = parseInt(result[1], 16); - const g = parseInt(result[2], 16); - const b = parseInt(result[3], 16); - return `rgba(${r}, ${g}, ${b}, ${a})`; -}; - const rootEl = $ref(null); const chartEl = $ref(null); const now = new Date(); diff --git a/packages/frontend/src/pages/admin/metrics.vue b/packages/frontend/src/pages/admin/metrics.vue index db8e448639..6c4803fe0b 100644 --- a/packages/frontend/src/pages/admin/metrics.vue +++ b/packages/frontend/src/pages/admin/metrics.vue @@ -53,54 +53,47 @@