From 2547c8c11799ee9bc997185d4472b7403986d6d7 Mon Sep 17 00:00:00 2001
From: syuilo <Syuilotan@yahoo.co.jp>
Date: Wed, 28 Dec 2022 13:42:30 +0900
Subject: refactor

---
 packages/frontend/src/pages/admin/overview.queue.chart.vue | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

(limited to 'packages/frontend/src/pages/admin/overview.queue.chart.vue')

diff --git a/packages/frontend/src/pages/admin/overview.queue.chart.vue b/packages/frontend/src/pages/admin/overview.queue.chart.vue
index 1e095bddaa..2552e0a6c3 100644
--- a/packages/frontend/src/pages/admin/overview.queue.chart.vue
+++ b/packages/frontend/src/pages/admin/overview.queue.chart.vue
@@ -26,6 +26,7 @@ import * as os from '@/os';
 import { defaultStore } from '@/store';
 import { useChartTooltip } from '@/scripts/use-chart-tooltip';
 import { chartVLine } from '@/scripts/chart-vline';
+import { alpha } from '@/scripts/color';
 
 Chart.register(
 	ArcElement,
@@ -48,14 +49,6 @@ const props = defineProps<{
 	type: string;
 }>();
 
-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 chartEl = ref<HTMLCanvasElement>(null);
 
 const gridColor = defaultStore.state.darkMode ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.1)';
-- 
cgit v1.2.3-freya

