|
@@ -32,9 +32,9 @@ export function isDark() {
|
|
|
|
|
|
export function colorMatchTheme(hexColor: string) {
|
|
export function colorMatchTheme(hexColor: string) {
|
|
if (isDark()) {
|
|
if (isDark()) {
|
|
- return lightenHexColor(hexColor);
|
|
|
|
|
|
+ return lightenHexColor(hexColor)
|
|
}
|
|
}
|
|
- return hexColor;
|
|
|
|
|
|
+ return hexColor
|
|
}
|
|
}
|
|
|
|
|
|
export function formateDateAccurateToDay(date: Date | string | number, nick = true): string {
|
|
export function formateDateAccurateToDay(date: Date | string | number, nick = true): string {
|
|
@@ -68,3 +68,12 @@ export async function delay(ms: number) {
|
|
setTimeout(resolve, ms)
|
|
setTimeout(resolve, ms)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+export function generateUUID() {
|
|
|
|
+ let d = new Date().getTime()
|
|
|
|
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
|
|
+ const r = (d + Math.random() * 16) % 16 | 0
|
|
|
|
+ d = Math.floor(d / 16)
|
|
|
|
+ return (c == 'x' ? r : (r & 0x3) | 0x8).toString(16)
|
|
|
|
+ })
|
|
|
|
+}
|