This repository has been archived by the owner on Jul 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
antiphoton.erb
294 lines (256 loc) · 10.4 KB
/
antiphoton.erb
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
<%
# RNB, A VIM COLORSCHEME TEMPLATE
# Author: Romain Lafourcade (https://github.com/romainl)
# Canonical URL: https://github.com/romainl/vim-rnb
information = {
author: "Alex Vear",
email: "alex@vear.uk",
name: "antiphoton",
description: "An elegant, light colour scheme with minimal syntax highlighting",
background: "light",
webpage: "https://github.com/axvr/photon.vim",
licence: "MIT (2020)"
}
# Color palette:
#
# black = [ give each color a distinctive name
# "#000000", hexadecimal color used in GVim/MacVim or "NONE"
# 0, integer between 0 and 255 used by terminals supporting 256 colors
# or "NONE"
# "black" color name used by less capable color terminals, can be "darkred",
# "red", "darkgreen", "green", "darkyellow", "yellow", "darkblue",
# "blue", "darkmagenta", "magenta", "black", "darkgrey", "grey",
# "white", or "NONE"
# ]
#
# If your colors are defined correctly, the resulting colorscheme is
# guaranteed to work in GVim (Windows/Linux), MacVim (MacOS), and any
# properly set up terminal emulator.
# Background
bg = ["#ffffff", 231, "white"]
# Darker background shades
bgd_1 = ["#eeeeee", 255, "white"]
bgd_2 = ["#e4e4e4", 254, "white"]
bgd_3 = ["#dadada", 253, "grey"]
bgd_4 = ["#949494", 246, "gray"]
# Foreground
fg = ["#121212", 233, "black"]
# Lighter background shades
fgl_1 = ["#303030", 236, "black"]
fgl_2 = ["#4e4e4e", 239, "darkgrey"]
# Accents
purple = ["#af5fd7", 134, "darkmagenta"]
orange = ["#d75f5f", 203, "red"]
grey = ["#6c6c6c", 242, "darkgray"]
green = ["#008700", 28, "darkgreen"]
red = ["#af0000", 124, "darkred"]
yellow = ["#d75f00", 166, "darkyellow"]
# Highlights:
#
# You can define highlight groups like this:
#
# [ "Normal", name of the highlight group
# white, the color used for background color, or use "NONE", "fg" or "bg"
# darkgray, the color used for foreground color, or use "NONE", "fg" or "bg"
# "NONE" style, can be "bold", "underline", "reverse", "italic",
# "standout", "NONE" or "undercurl"
# ]
#
# The sample above tells Vim to render normal text in dark gray against
# a white background, without any other styling.
#
# Or you can link an highlight group to another. Here, "Title" will inherit
# its style from "Normal":
#
# [ "Title", "Normal" ]
#
# In GUI Vim, there is an additional color for the undercurl used to
# highlight spelling mistakes:
#
# [ "SpellBad", name of the highlight group
# "NONE", the color used for background color, or use "NONE", "fg" or "bg"
# red, the color used for foreground color, or use "NONE", "fg" or "bg"
# "undercurl", style
# red color used for the undercurl
# ]
#
# The sample above tells Vim to render badly spelled words in red against
# the current background, with a red undercurl.
highlights = [
[ "Normal", bg, fg, "NONE" ],
[ "NonText", "bg", bgd_3, "NONE" ],
[ "Comment", "bg", bgd_4, "NONE" ],
[ "Conceal", "bg", grey, "NONE" ],
[ "Constant", "bg", purple, "NONE" ],
[ "Character", "Constant" ],
[ "Number", "Constant" ],
[ "Float", "Number" ],
[ "Boolean", "Constant" ],
[ "String", "Constant" ],
[ "Identifier", "bg", fg, "NONE" ],
[ "Function", "Identifier" ],
[ "Statement", "bg", grey, "NONE" ],
[ "Conditonal", "Statement" ],
[ "Repeat", "Statement" ],
[ "Label", "Statement" ],
[ "Keyword", "Statement" ],
[ "Exception", "Statement" ],
[ "Operator", "bg", fg, "NONE" ],
[ "PreProc", "bg", grey, "NONE" ],
[ "Include", "PreProc" ],
[ "Define", "PreProc" ],
[ "Macro", "PreProc" ],
[ "PreCondit", "PreProc" ],
[ "Type", "bg", fg, "NONE" ],
[ "StorageClass", "Type" ],
[ "Structure", "Type" ],
[ "Typedef", "Type" ],
[ "Special", "NONE", grey, "NONE" ],
[ "SpecialChar", "Special" ],
[ "Tag", "Special" ],
[ "Delimiter", "Special" ],
[ "SpecialComment", "Special" ],
[ "Debug", "Special" ],
[ "Error", "NONE", red, "NONE" ],
[ "ErrorMsg", "Error" ],
[ "Warning", "NONE", yellow, "NONE" ],
[ "WarningMsg", "Warning" ],
[ "ModeMsg", "NONE", grey, "NONE" ],
[ "MoreMsg", "ModeMsg" ],
[ "Question", "ModeMsg" ],
[ "Ignore", "NonText" ],
[ "Todo", "NONE", orange, "bold" ],
[ "Underlined", "NONE", fg, "underline" ],
[ "StatusLine", bgd_2, purple, "bold" ],
[ "StatusLineNC", bgd_1, grey, "NONE" ],
[ "StatusLineTerm", "StatusLine" ],
[ "StatusLineTermNC", "StatusLineNC" ],
[ "TabLine", bgd_3, grey, "NONE"],
[ "TabLineFill", "TabLine" ],
[ "TabLineSel", bgd_1, purple, "bold" ],
[ "WildMenu", orange, bg, "NONE" ],
[ "VertSplit", bgd_1, bgd_1, "NONE" ],
[ "Title", "NONE", fg, "bold" ],
[ "LineNr", "NONE", bgd_4, "NONE" ],
[ "CursorLineNr", bgd_1, purple, "NONE" ],
[ "Cursor", purple, fg, "NONE" ],
[ "CursorLine", bgd_1, "NONE", "NONE" ],
[ "CursorColumn", "CursorLine" ],
[ "ColorColumn", "CursorColumn" ],
[ "SignColumn", "NONE", grey, "NONE" ],
[ "Visual", bgd_2, "NONE", "NONE" ],
[ "VisualNOS", bgd_3, "NONE", "NONE" ],
[ "Pmenu", bgd_1, grey, "NONE" ],
[ "PmenuSbar", bgd_2, "NONE", "NONE" ],
[ "PmenuSel", bgd_2, purple, "bold" ],
[ "PmenuThumb", orange, "NONE", "NONE" ],
[ "Folded", bgd_3, grey, "NONE" ],
[ "FoldColumn", "NONE", yellow, "NONE" ],
[ "SpecialKey", "NONE", grey, "NONE" ],
[ "IncSearch", orange, bg, "NONE" ],
[ "Search", purple, bg, "NONE" ],
[ "Directory", "NONE", purple, "NONE" ],
[ "MatchParen", "NONE", orange, "bold" ],
[ "SpellBad", "NONE", red, "underline" ],
[ "SpellCap", "NONE", green, "underline" ],
[ "SpellLocal", "NONE", yellow, "underline" ],
[ "SpellRare", "SpellLocal" ],
[ "QuickFixLine", bgd_3, "NONE", "NONE" ],
[ "DiffAdd", bgd_1, green, "NONE" ],
[ "DiffChange", bgd_1, "NONE", "NONE" ],
[ "DiffDelete", bgd_1, red, "NONE" ],
[ "DiffText", bgd_1, yellow, "NONE" ],
[ "diffAdded", "DiffAdd" ],
[ "diffRemoved", "DiffDelete" ],
[ "helpHyperTextJump", "bg", purple, "NONE" ],
[ "htmlTag", "htmlTagName" ],
[ "htmlEndTag", "htmlTag" ],
[ "gitcommitSummary", "Title" ]
]
# Define the color palette used by :terminal when in GUI Vim or in TUI Vim
# when 'termguicolors' is enabled. If this list is empty or if it doesn't
# contain exactly 16 items, the corresponding Vim variable won't be set.
terminal_ansi_colors = [
# Dark
fgl_1, # black
red, # red
green, # green
["#a2734c"], # yellow
["#12488b"], # blue
["#a347ba"], # magenta
["#2aa1b3"], # cyan
bgd_4, # white
# Bright
fgl_2, # black
orange, # red
["#33d17a"], # green
yellow, # yellow
["#2a7bde"], # blue
purple, # magenta
["#33c7de"], # cyan
bgd_2 # white
]
# Many thanks to Barry Arthur (https://github.com/dahu) for the original idea.
-%>
" Name: <%= information[:name] %>.vim
" Author: <%= information[:author] %> <<%= information[:email] %>>
" Webpage: <%= information[:webpage] %>
" Description: <%= information[:description] %>
" Licence: <%= information[:licence] %>
" Last Change: <%= Time.new.strftime "%Y-%m-%d" %>
hi clear
if exists("syntax_on")
syntax reset
endif
let colors_name = "<%= information[:name].downcase %>"
if ($TERM =~ '256' || &t_Co >= 256) || has("gui_running")
<% for highlight in highlights -%>
<% if highlight.length == 4 -%>
hi <%= highlight[0] %> ctermbg=<%= highlight[1].kind_of?(String) ? highlight[1] : highlight[1][1] %> ctermfg=<%= highlight[2].kind_of?(String) ? highlight[2] : highlight[2][1] %> cterm=<%= highlight[3] %> guibg=<%= highlight[1].kind_of?(String) ? highlight[1] : highlight[1][0] %> guifg=<%= highlight[2].kind_of?(String) ? highlight[2] : highlight[2][0] %> gui=<%= highlight[3] %>
<% if highlight[0] == "Normal" -%>
<%= '' %>
set background=<%= information[:background] %>
<%= '' %>
<% end -%>
<% elsif highlight.length > 4 -%>
hi <%= highlight[0] %> ctermbg=<%= highlight[1].kind_of?(String) ? highlight[1] : highlight[1][1] %> ctermfg=<%= highlight[2].kind_of?(String) ? highlight[2] : highlight[2][1] %> cterm=<%= highlight[3] %> guibg=<%= highlight[1].kind_of?(String) ? highlight[1] : highlight[1][0] %> guifg=<%= highlight[2].kind_of?(String) ? highlight[2] : highlight[2][0] %> gui=<%= highlight[3] %> guisp=<%= highlight[4].kind_of?(String) ? highlight[4] : highlight[4][0] %>
<% end -%>
<% end -%>
elseif &t_Co == 8 || $TERM !~# '^linux' || &t_Co == 16
set t_Co=16
<%= '' %>
<% for highlight in highlights -%>
<% if highlight.length > 2 -%>
hi <%= highlight[0] %> ctermbg=<%= highlight[1].kind_of?(String) ? highlight[1] : highlight[1][2] %> ctermfg=<%= highlight[2].kind_of?(String) ? highlight[2] : highlight[2][2] %> cterm=<%= highlight[3] %>
<% if highlight[0] == "Normal" -%>
<%= '' %>
set background=<%= information[:background] %>
<%= '' %>
<% end -%>
<% end -%>
<% end -%>
endif
<% links = highlights.select do |highlight| -%>
<% highlight.length == 2 -%>
<% end -%>
<% if links.length > 0 -%>
<%= '' %>
<% for link in links -%>
hi! link <%= link[0] %> <%= link[1] %>
<% end -%>
<% end -%>
<% if terminal_ansi_colors.length == 16 -%>
<%= '' %>
if has('nvim')
<% terminal_ansi_colors.each_with_index do |color,index| -%>
let g:terminal_color_<%= index %> = '<%= color[0] %>'
<% end -%>
else
let g:terminal_ansi_colors = [
<% for color in terminal_ansi_colors -%>
\ '<%= color[0] %>',
<% end -%>
\ ]
endif
<% end -%>
" Generated with RNB (https://github.com/romainl/vim-rnb)