分离识别结果标签页;限制 DMA 数量最大数量
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
export const AREA_COLORS = [
|
||||
"#2563eb",
|
||||
"#7c3aed",
|
||||
"#0891b2",
|
||||
"#16a34a",
|
||||
"#ca8a04",
|
||||
"#dc2626",
|
||||
"#ea580c",
|
||||
"#0f766e",
|
||||
"#4338ca",
|
||||
"#be123c",
|
||||
];
|
||||
|
||||
export const getAreaColor = (areaId: string | number | undefined) => {
|
||||
const text = String(areaId ?? "");
|
||||
let hash = 0;
|
||||
for (let i = 0; i < text.length; i += 1) {
|
||||
hash = (hash * 31 + text.charCodeAt(i)) >>> 0;
|
||||
}
|
||||
return AREA_COLORS[hash % AREA_COLORS.length];
|
||||
};
|
||||
Reference in New Issue
Block a user