Skip to content

Commit ab9be6e

Browse files
committed
refactor: update tag colors
1 parent 282052e commit ab9be6e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

client/src/utils/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { TAG_COLORS } from "@/constants";
2+
13
const colors = ['#52c41a', '#f5222d', '#1890ff', '#faad14', '#ff0064', '#722ed1'];
24

35
export const getRandomColor = (() => {
@@ -150,7 +152,7 @@ export const scrollToBottom = (el: HTMLElement) => {
150152

151153

152154
export function getColorFromNumber(num) {
153-
const colors = ['#dc3545', '#17a2b8', '#00b74a', '#fc651f', '#6c757d', '#f5c800', '#808695'];
155+
const colors = ['#dc3545', '#17a2b8', '#00b74a', '#fc651f', '#6c757d', '#f5c800', '#808695'].concat(TAG_COLORS);
154156
const index = num % colors.length;
155157
return colors[index];
156158
}

0 commit comments

Comments
 (0)