-
-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy pathgithub_light_tritanopia.lua
245 lines (215 loc) · 7.53 KB
/
github_light_tritanopia.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
local C = require('github-theme.lib.color')
local meta = {
name = 'github_light_tritanopia',
light = true,
}
---Github Light scale variables
---source: https://github.com/primer/primitives/blob/main/data/colors/themes/light_tritanopia.ts
-- stylua: ignore
local scale = {
black = '#1b1f24',
white = '#ffffff',
gray = {
'#f6f8fa', '#eaeef2', '#d0d7de', '#afb8c1', '#8c959f',
'#6e7781', '#57606a', '#424a53', '#32383f', '#24292f',
},
blue = {
'#ddf4ff', '#b6e3ff', '#80ccff', '#54aeff', '#218bff',
'#0969da', '#0550ae', '#033d8b', '#0a3069', '#002155',
},
green = {
'#ddf4ff', '#b6e3ff', '#80ccff', '#54aeff', '#218bff',
'#0969da', '#0550ae', '#033d8b', '#0a3069', '#002155',
},
yellow = {
'#fff8c5', '#fae17d', '#eac54f', '#d4a72c', '#bf8700',
'#9a6700', '#7d4e00', '#633c01', '#4d2d00', '#3b2300',
},
orange = {
'#ffebe9', '#ffcecb', '#ffaba8', '#ff8182', '#fa4549',
'#cf222e', '#a40e26', '#82071e', '#660018', '#4c0014',
},
red = {
'#ffebe9', '#ffcecb', '#ffaba8', '#ff8182', '#fa4549',
'#cf222e', '#a40e26', '#82071e', '#660018', '#4c0014',
},
purple = {
'#fbefff', '#ecd8ff', '#d8b9ff', '#c297ff', '#a475f9',
'#8250df', '#6639ba', '#512a97', '#3e1f79', '#2e1461',
},
pink = {
'#ffeff7', '#ffd3eb', '#ffadda', '#ff80c8', '#e85aad',
'#bf3989', '#99286e', '#772057', '#611347', '#4d0336',
},
coral = {
'#fff0eb', '#ffd6cc', '#ffb4a1', '#fd8c73', '#ec6547',
'#c4432b', '#9e2f1c', '#801f0f', '#691105', '#510901',
},
}
C.WHITE = C(scale.white)
C.BLACK = C(scale.black)
C.BG = C(scale.white)
local function alpha(color, a)
return color:alpha_blend(a):to_css()
end
-- Temp override until Primitives are updated
local palette = {
scale = scale,
orange = scale.orange[4],
gray = scale.gray[6],
black = { base = scale.gray[10], bright = scale.gray[7] },
white = { base = scale.gray[6], bright = scale.gray[5] },
red = { base = scale.red[6], bright = scale.red[7] },
green = { base = scale.green[7], bright = scale.green[6] },
yellow = { base = scale.yellow[9], bright = scale.yellow[8] },
blue = { base = scale.blue[6], bright = scale.blue[5] },
magenta = { base = scale.purple[6], bright = scale.purple[5] },
pink = { base = scale.pink[6], bright = scale.pink[5] },
cyan = { base = '#1b7c83', bright = '#3192aa' },
fg = {
default = scale.black,
muted = scale.gray[3],
subtle = scale.gray[6],
on_emphasis = scale.white,
},
canvas = {
default = scale.white,
overlay = scale.white,
inset = scale.gray[1],
subtle = scale.gray[1],
},
border = {
default = scale.gray[3],
muted = C(scale.gray[3]):lighten(0.03), -- TODO: lighten method not working
subtle = alpha(C(scale.black), 0.15),
},
neutral = {
emphasis_plus = scale.gray[10],
emphasis = scale.gray[6],
muted = alpha(C(scale.gray[4]), 0.2),
subtle = alpha(C(scale.gray[2]), 0.5),
},
accent = {
fg = scale.blue[6],
emphasis = scale.blue[6],
muted = alpha(C(scale.blue[4]), 0.4),
subtle = scale.blue[1],
},
success = {
fg = scale.green[6],
emphasis = '#1f883d',
muted = alpha(C(scale.green[4]), 0.4),
subtle = scale.green[1],
},
attention = {
fg = scale.yellow[6],
emphasis = scale.yellow[6],
muted = alpha(C(scale.yellow[4]), 0.4),
subtle = scale.yellow[1],
},
severe = {
fg = scale.orange[6],
emphasis = scale.orange[6],
muted = alpha(C(scale.orange[4]), 0.4),
subtle = scale.orange[1],
},
danger = {
fg = '#d1242f',
emphasis = scale.red[6],
muted = alpha(C(scale.red[4]), 0.4),
subtle = scale.red[1],
},
open = {
fg = scale.green[6],
emphasis = '#1f883d',
muted = alpha(C(scale.green[4]), 0.4),
subtle = scale.green[1],
},
closed = {
fg = '#d1242f',
emphasis = scale.red[6],
muted = alpha(C(scale.red[4]), 0.4),
subtle = scale.red[1],
},
done = {
fg = scale.purple[6],
emphasis = scale.purple[6],
muted = alpha(C(scale.purple[4]), 0.4),
subtle = scale.purple[1],
},
sponsors = {
fg = scale.pink[6],
emphasis = scale.pink[6],
muted = alpha(C(scale.pink[4]), 0.4),
subtle = scale.pink[1],
},
}
local function generate_spec(pal)
-- stylua: ignore start
local spec = {
bg0 = pal.canvas.inset, -- Dark bg (popup and float)
bg1 = pal.canvas.default, -- Default bg
bg2 = alpha(C(pal.neutral.emphasis), 0.1), -- Lighter bg (colorcolumn Folds)
bg3 = pal.scale.gray[2], -- Lighter bg (cursor line)
bg4 = pal.scale.gray[6], -- Conceal
fg0 = pal.fg.subtle, -- Lighter fg
fg1 = pal.fg.default, -- Default fg
fg2 = pal.scale.gray[9], -- Darker fg (status line)
fg3 = pal.scale.gray[7], -- Darker fg (line numbers, fold columns)
sel0 = alpha(C(pal.accent.fg), 0.2), -- Visual selection bg
sel1 = alpha(C(pal.accent.muted), 0.90), -- Popup sel bg
sel2 = alpha(C(pal.attention.emphasis), 0.3) -- Search bg
}
spec.syntax = {
bracket = pal.scale.orange[5], -- Brackets and Punctuation
builtin0 = pal.scale.red[6], -- Builtin variable
builtin1 = pal.scale.red[6], -- Builtin type
builtin2 = pal.scale.blue[7], -- Builtin const
comment = pal.scale.gray[6], -- Comment
conditional = pal.scale.red[6], -- Conditional and loop
const = pal.scale.blue[6], -- Constants, imports and booleans
dep = pal.scale.red[8], -- Deprecated
field = spec.fg1, -- Field
func = pal.scale.purple[6], -- Functions and Titles
ident = pal.scale.blue[9], -- Identifiers
keyword = pal.scale.red[6], -- Keywords
number = pal.scale.blue[7], -- Numbers
operator = pal.scale.red[6], -- Operators
param = pal.scale.orange[5], -- PreProc
preproc = pal.scale.red[6], -- PreProc
regex = pal.scale.blue[9], -- Regex
statement = pal.scale.red[6], -- Statements
string = pal.scale.blue[8], -- Strings
type = pal.scale.red[6], -- Types
tag = pal.scale.green[6], -- Tags
variable = spec.fg1, -- Variables
}
spec.diag = {
error = pal.danger.fg,
warn = pal.attention.fg,
info = pal.accent.fg,
hint = pal.fg.muted,
}
spec.diag_bg = {
error = C(spec.bg1):blend(C(spec.diag.error), 0.15):to_css(),
warn = C(spec.bg1):blend(C(spec.diag.warn), 0.15):to_css(),
info = C(spec.bg1):blend(C(spec.diag.info), 0.15):to_css(),
hint = C(spec.bg1):blend(C(spec.diag.hint), 0.15):to_css(),
}
spec.diff = {
add = alpha(C(pal.scale.green[2]), 0.3),
delete = alpha(C(pal.scale.red[2]), 0.3),
change = alpha(C(pal.scale.yellow[2]), 0.3),
text = spec.fg0
}
spec.git = {
add = pal.success.fg,
removed = pal.danger.fg,
changed = pal.attention.fg,
conflict = pal.severe.fg,
ignored = pal.fg.subtle,
}
-- stylua: ignore end
return spec
end
return { meta = meta, palette = palette, generate_spec = generate_spec }