Skip to content

Commit 9ce8e5d

Browse files
committed
Drop dead exports and unreachable OKLCHHueDistance
1 parent c231289 commit 9ce8e5d

4 files changed

Lines changed: 1 addition & 34 deletions

File tree

frontend/src/lib/stores/recentColors.svelte.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,3 @@ export function pushRecentColor(hex: string): void {
4040
recent = next;
4141
persist(next);
4242
}
43-
44-
export function clearRecentColors(): void {
45-
recent = [];
46-
persist([]);
47-
}

frontend/src/lib/stores/wallhaven.svelte.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ export function getSorting(): string {
8080
export function getOrder(): string {
8181
return order;
8282
}
83-
export function getPage(): number {
84-
return page;
85-
}
8683
export function getAtleast(): string {
8784
return atleast;
8885
}
@@ -95,9 +92,6 @@ export function getApiKey(): string {
9592
export function getResults(): any[] {
9693
return results;
9794
}
98-
export function getTotalPages(): number {
99-
return totalPages;
100-
}
10195
export function getTotalResults(): number {
10296
return totalResults;
10397
}
@@ -129,9 +123,6 @@ export function setOrder(o: string): void {
129123
order = o;
130124
persist();
131125
}
132-
export function setPage(p: number): void {
133-
page = p;
134-
}
135126
export function setAtleast(a: string): void {
136127
atleast = a;
137128
persist();

frontend/src/lib/utils/color.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function hexToHsl(hex: string): {h: number; s: number; l: number} {
7474
return {h: h * 360, s: s * 100, l: l * 100};
7575
}
7676

77-
export function hue2rgb(p: number, q: number, t: number): number {
77+
function hue2rgb(p: number, q: number, t: number): number {
7878
if (t < 0) t += 1;
7979
if (t > 1) t -= 1;
8080
if (t < 1 / 6) return p + (q - p) * 6 * t;
@@ -204,15 +204,6 @@ export function relativeLuminance(hex: string): number {
204204
return 0.2126 * chan(r) + 0.7152 * chan(g) + 0.0722 * chan(b);
205205
}
206206

207-
// WCAG 2.1 contrast ratio. Symmetric: caller doesn't need to pass lighter first.
208-
// Range is 1 (no contrast) to 21 (pure black on pure white).
209-
export function contrastRatio(a: string, b: string): number {
210-
const la = relativeLuminance(a);
211-
const lb = relativeLuminance(b);
212-
const [hi, lo] = la > lb ? [la, lb] : [lb, la];
213-
return (hi + 0.05) / (lo + 0.05);
214-
}
215-
216207
/**
217208
* Categorize a WCAG contrast ratio. Thresholds per WCAG 2.1 SC 1.4.3 / 1.4.6:
218209
* AAA ≥ 7 (normal text)

internal/color/oklab.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,3 @@ func OKLabDistance(a, b OKLab) float64 {
150150
db := a.B - b.B
151151
return math.Sqrt(dl*dl + da*da + db*db)
152152
}
153-
154-
// OKLCHHueDistance calculates the circular hue distance between two OKLCH hues.
155-
// Returns a value between 0 and 180 degrees.
156-
func OKLCHHueDistance(h1, h2 float64) float64 {
157-
diff := math.Abs(h1 - h2)
158-
if diff > 180 {
159-
diff = 360 - diff
160-
}
161-
return diff
162-
}

0 commit comments

Comments
 (0)