From 63591da33e233b2ed0ab331ae6bb3c9eff5020ae Mon Sep 17 00:00:00 2001 From: Johann150 Date: Sat, 23 Jul 2022 23:00:59 +0200 Subject: [PATCH] refactor: colours in queue chart --- .../client/src/components/queue-chart.vue | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/packages/client/src/components/queue-chart.vue b/packages/client/src/components/queue-chart.vue index 7bb548cf0..cc684295c 100644 --- a/packages/client/src/components/queue-chart.vue +++ b/packages/client/src/components/queue-chart.vue @@ -42,14 +42,6 @@ Chart.register( Filler, ); -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})`; -}; - export default defineComponent({ props: { domain: { @@ -81,7 +73,7 @@ export default defineComponent({ borderWidth: 2, borderJoinStyle: 'round', borderColor: '#00E396', - backgroundColor: alpha('#00E396', 0.1), + backgroundColor: '#00E3961A', data: [] }, { label: 'Active', @@ -90,7 +82,7 @@ export default defineComponent({ borderWidth: 2, borderJoinStyle: 'round', borderColor: '#00BCD4', - backgroundColor: alpha('#00BCD4', 0.1), + backgroundColor: '#00BCD41A', data: [] }, { label: 'Waiting', @@ -99,7 +91,7 @@ export default defineComponent({ borderWidth: 2, borderJoinStyle: 'round', borderColor: '#FFB300', - backgroundColor: alpha('#FFB300', 0.1), + backgroundColor: '#FFB3001A', yAxisID: 'y2', data: [] }, { @@ -130,7 +122,7 @@ export default defineComponent({ grid: { display: true, color: gridColor, - borderColor: 'rgb(0, 0, 0, 0)', + borderColor: '#0000', }, ticks: { display: false, @@ -143,7 +135,7 @@ export default defineComponent({ stackWeight: 2, grid: { color: gridColor, - borderColor: 'rgb(0, 0, 0, 0)', + borderColor: '#0000', }, }, y2: { @@ -153,7 +145,7 @@ export default defineComponent({ stackWeight: 1, grid: { color: gridColor, - borderColor: 'rgb(0, 0, 0, 0)', + borderColor: '#0000', }, }, },