@seanmozeik/avicon 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,162 @@
1
+ import pc from "picocolors";
2
+
3
+ // Catppuccin Frappe palette
4
+ // https://github.com/catppuccin/catppuccin
5
+ const palette = {
6
+ base: "#303446",
7
+ blue: "#8caaee",
8
+ crust: "#232634",
9
+ flamingo: "#eebebe",
10
+ green: "#a6d189",
11
+ lavender: "#babbf1",
12
+ mantle: "#292c3c",
13
+ maroon: "#ea999c",
14
+ mauve: "#ca9ee6",
15
+ overlay0: "#737994",
16
+ overlay1: "#838ba7",
17
+ overlay2: "#949cbb",
18
+ peach: "#ef9f76",
19
+ pink: "#f4b8e4",
20
+ red: "#e78284",
21
+ rosewater: "#f2d5cf",
22
+ sapphire: "#85c1dc",
23
+ sky: "#99d1db",
24
+ subtext0: "#a5adce",
25
+ subtext1: "#b5bfe2",
26
+ surface0: "#414559",
27
+ surface1: "#51576d",
28
+ surface2: "#626880",
29
+ teal: "#81c8be",
30
+ text: "#c6d0f5",
31
+ yellow: "#e5c890",
32
+ } as const;
33
+
34
+ // ANSI 256-color approximations for Catppuccin Frappe
35
+ // These are the closest matches in the 256-color palette
36
+ const ansi = {
37
+ base: 236,
38
+ blue: 111,
39
+ crust: 234,
40
+ flamingo: 217,
41
+ green: 150,
42
+ lavender: 147,
43
+ mantle: 235,
44
+ maroon: 217,
45
+ mauve: 183,
46
+ overlay0: 60,
47
+ overlay1: 103,
48
+ overlay2: 103,
49
+ peach: 216,
50
+ pink: 218,
51
+ red: 210,
52
+ rosewater: 224,
53
+ sapphire: 110,
54
+ sky: 117,
55
+ subtext0: 146,
56
+ subtext1: 146,
57
+ surface0: 59,
58
+ surface1: 59,
59
+ surface2: 60,
60
+ teal: 116,
61
+ text: 189,
62
+ yellow: 223,
63
+ } as const;
64
+
65
+ // Color functions using ANSI 256 colors
66
+ function ansiColor(code: number): (text: string) => string {
67
+ return (text: string) => `\x1b[38;5;${code}m${text}\x1b[0m`;
68
+ }
69
+
70
+ function ansiBg(code: number): (text: string) => string {
71
+ return (text: string) => `\x1b[48;5;${code}m${text}\x1b[0m`;
72
+ }
73
+
74
+ // Theme colors as functions
75
+ export const frappe = {
76
+ // Base colors
77
+ base: ansiColor(ansi.base),
78
+
79
+ // Background variants
80
+ bg: {
81
+ base: ansiBg(ansi.base),
82
+ surface0: ansiBg(ansi.surface0),
83
+ surface1: ansiBg(ansi.surface1),
84
+ },
85
+ blue: ansiColor(ansi.blue),
86
+ crust: ansiColor(ansi.crust),
87
+ flamingo: ansiColor(ansi.flamingo),
88
+ green: ansiColor(ansi.green),
89
+ lavender: ansiColor(ansi.lavender),
90
+ mantle: ansiColor(ansi.mantle),
91
+ maroon: ansiColor(ansi.maroon),
92
+ mauve: ansiColor(ansi.mauve),
93
+ overlay0: ansiColor(ansi.overlay0),
94
+ overlay1: ansiColor(ansi.overlay1),
95
+
96
+ // Overlay colors
97
+ overlay2: ansiColor(ansi.overlay2),
98
+ peach: ansiColor(ansi.peach),
99
+ pink: ansiColor(ansi.pink),
100
+ red: ansiColor(ansi.red),
101
+ // Primary accent colors
102
+ rosewater: ansiColor(ansi.rosewater),
103
+ sapphire: ansiColor(ansi.sapphire),
104
+ sky: ansiColor(ansi.sky),
105
+ subtext0: ansiColor(ansi.subtext0),
106
+ subtext1: ansiColor(ansi.subtext1),
107
+ surface0: ansiColor(ansi.surface0),
108
+ surface1: ansiColor(ansi.surface1),
109
+
110
+ // Surface colors
111
+ surface2: ansiColor(ansi.surface2),
112
+ teal: ansiColor(ansi.teal),
113
+
114
+ // Text colors
115
+ text: ansiColor(ansi.text),
116
+ yellow: ansiColor(ansi.yellow),
117
+ } as const;
118
+
119
+ // Semantic aliases for common use cases
120
+ export const theme = {
121
+ accent: frappe.flamingo,
122
+
123
+ // Diff colors
124
+ added: frappe.green,
125
+ body: frappe.subtext1,
126
+ dim: frappe.surface2,
127
+ error: frappe.red,
128
+
129
+ // Text
130
+ heading: frappe.text,
131
+ info: frappe.blue,
132
+ modified: frappe.yellow,
133
+ muted: frappe.overlay1,
134
+
135
+ // UI elements
136
+ primary: frappe.mauve,
137
+ removed: frappe.red,
138
+ secondary: frappe.pink,
139
+ subtle: frappe.subtext0,
140
+ // Status colors
141
+ success: frappe.green,
142
+ warning: frappe.yellow,
143
+ } as const;
144
+
145
+ // Gradient colors for banner (hex values for gradient-string)
146
+ export const gradientColors = {
147
+ banner: [palette.mauve, palette.pink, palette.flamingo],
148
+ error: [palette.red, palette.maroon],
149
+ success: [palette.green, palette.teal],
150
+ } as const;
151
+
152
+ // Box border color (hex for boxen)
153
+ export const boxColors = {
154
+ default: palette.surface2,
155
+ error: palette.red,
156
+ info: palette.blue,
157
+ primary: palette.mauve,
158
+ success: palette.green,
159
+ } as const;
160
+
161
+ // Re-export picocolors for basic formatting
162
+ export { pc };