Lint & format

This commit is contained in:
Andras Schmelczer 2025-06-07 22:24:27 +01:00
parent 7e3f972531
commit 57b2b76932
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
21 changed files with 89 additions and 74 deletions

View file

@ -1,4 +1,4 @@
import { Editor } from "obsidian";
import type { Editor } from "obsidian";
import { lineAndColumnToPosition } from "./line-and-column-to-position";
export interface Cursor {

View 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
}