Lint & format
This commit is contained in:
parent
7e3f972531
commit
57b2b76932
21 changed files with 89 additions and 74 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { Editor } from "obsidian";
|
||||
import type { Editor } from "obsidian";
|
||||
import { lineAndColumnToPosition } from "./line-and-column-to-position";
|
||||
|
||||
export interface Cursor {
|
||||
|
|
|
|||
9
frontend/obsidian-plugin/src/utils/get-random-color.ts
Normal file
9
frontend/obsidian-plugin/src/utils/get-random-color.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
export function getRandomColor(name: string): string {
|
||||
let hash = 0;
|
||||
for (let i = 0; i < name.length; i++) {
|
||||
hash = (hash << 5) - hash + name.charCodeAt(i);
|
||||
hash |= 0; // Convert to 32bit integer
|
||||
}
|
||||
const normalised = hash / 0x7fffffff;
|
||||
return `hsl(${Math.abs(normalised * 360)}, 70%, 30%)`; // HSL color
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue