mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-17 04:32:15 +01:00
add table group chart, adapt to api changes
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import Prando from '@/utils/random';
|
||||
|
||||
export const colors = [
|
||||
'#ef5350',
|
||||
'#ec407a',
|
||||
@@ -23,3 +25,9 @@ export const colors = [
|
||||
export function getRandomColor() {
|
||||
return colors[Math.floor(Math.random() * colors.length)];
|
||||
}
|
||||
|
||||
export function getRandomColorWithSeed(seed: string) {
|
||||
const pseudoRandom = new Prando(seed);
|
||||
const index = pseudoRandom.nextInt(0, colors.length - 1);
|
||||
return colors[index];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user