summary refs log tree commit diff
path: root/claude/hooks/make-colors.d.ts
diff options
context:
space:
mode:
authorskylar <me@casper>2026-11-28 05:59:53 -0800
committerskylar <me@casper>2026-11-28 05:59:53 -0800
commite4306e5435eef76bad7fa9b3b909362304a8a47e (patch)
treed7856752d733cf2ef4551b3f6c6125635060ab58 /claude/hooks/make-colors.d.ts
luxnox: one palette for light and dark themesHEAD main
palette.toml drives kitty, the dwl desktop (dwl, fuzzel, swaync, wob, wmenu), GTK, Qt, the console and Emacs; luxnox-toggle switches lux and nox. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'claude/hooks/make-colors.d.ts')
-rw-r--r--claude/hooks/make-colors.d.ts35
1 files changed, 35 insertions, 0 deletions
diff --git a/claude/hooks/make-colors.d.ts b/claude/hooks/make-colors.d.ts
new file mode 100644
index 0000000..24f01db
--- /dev/null
+++ b/claude/hooks/make-colors.d.ts
@@ -0,0 +1,35 @@
+import type { ThemeColors } from 'claude-code'
+
+type Hex = string
+
+type Mode = {
+ gray?: {
+ anchors?: { 'surface-0': Hex; 'text-primary': Hex } & Partial<
+ Record<'surface-1' | 'surface-2' | 'surface-3' | 'text-secondary' | 'text-muted', Hex>
+ >
+ stops?: Record<number, Hex>
+ }
+ roles?: Roles
+ git?: Partial<
+ Record<'added' | 'removed' | 'modified' | 'merged' | 'closed' | 'conflicting' | 'draft', Hex>
+ >
+}
+
+type Role = Hex | { seed?: Hex; stops?: Record<number, Hex>; fillShade?: number }
+
+type Roles = Partial<Record<'accent' | 'danger' | 'success' | 'warning' | 'pro', Role>>
+
+/** A whole theme from a few colors, and what fails. Throws on a color it can't use. */
+export function makeColors(definition: {
+ label: string
+ id?: string
+ roles?: Roles
+ light?: Mode
+ dark?: Mode
+ codeTheme?: { light?: string; dark?: string }
+ contrast?: 'more'
+ only?: 'light' | 'dark'
+}): { theme: ThemeColors; problems: string[] }
+
+/** What's wrong with a theme from anywhere, as plain lines. */
+export function checkColors(colors: unknown): string[]