forked from folke/tokyonight.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
colors.lua
194 lines (174 loc) · 6.65 KB
/
colors.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
local util = require("dullahan.util")
local hslutil = require("dullahan.hsl")
local hsl = hslutil.hslToHex
local M = {}
---@class Palette
M.default = {
none = "NONE",
base04 = hsl(0, 0, 4), -- #0a0a0a
base03 = hsl(0, 0, 8), -- #141414
base02 = hsl(0, 0, 11), -- #1c1c1c
base01 = hsl(0, 0, 67), -- #ababab
base00 = hsl(0, 0, 40), -- #666666
base0 = hsl(0, 0, 95), -- #f2f2f2
base1 = hsl(200, 100, 58), -- #29b8ff
base2 = hsl(0, 0, 35), -- #595959
base3 = hsl(0, 0, 78), -- #c7c7c7
base4 = hsl(0, 0, 100), -- #ffffff
yellow = hsl(245, 100, 68), -- #695cff
yellow100 = hsl(245, 100, 78), -- #988fff
yellow300 = hsl(245, 100, 73), -- #8175ff
yellow500 = hsl(245, 100, 68), -- #695cff
yellow700 = hsl(245, 100, 63), -- #5242ff
yellow900 = hsl(246, 100, 58), -- #3b29ff
orange = hsl(257, 100, 58), -- #6529ff
orange100 = hsl(257, 100, 80), -- #b699ff
orange300 = hsl(257, 100, 63), -- #7842ff
orange500 = hsl(257, 100, 58), -- #6529ff
orange700 = hsl(257, 100, 53), -- #530fff
orange900 = hsl(257, 100, 48), -- #4500f5
red = hsl(275, 100, 68), -- #bb5cff
red100 = hsl(275, 100, 80), -- #d499ff
red300 = hsl(275, 100, 72), -- #c370ff
red500 = hsl(275, 100, 68), -- #bb5cff
red700 = hsl(275, 100, 47), -- #8c00f0
red900 = hsl(275, 100, 42), -- #7d00d6
magenta = hsl(331, 100, 62), -- #ff3d9b
magenta100 = hsl(331, 100, 80), -- #ff99ca
magenta300 = hsl(331, 100, 73), -- #ff75b8
magenta500 = hsl(331, 100, 62), -- #ff3d9b
magenta700 = hsl(331, 100, 47), -- #f00074
magenta900 = hsl(331, 100, 42), -- #d60068
violet = hsl(215, 100, 62), -- #3d8eff
violet100 = hsl(214, 100, 80), -- #99c3ff
violet300 = hsl(215, 100, 70), -- #66a6ff
violet500 = hsl(215, 100, 62), -- #3d8eff
violet700 = hsl(215, 100, 50), -- #006aff
violet900 = hsl(215, 100, 42), -- #0059d6
blue = hsl(230, 100, 68), -- #5c77ff
blue100 = hsl(230, 100, 82), -- #a3b3ff
blue300 = hsl(230, 100, 76), -- #8599ff
blue500 = hsl(230, 100, 68), -- #5c77ff
blue700 = hsl(230, 100, 47), -- #0028f0
blue900 = hsl(230, 100, 42), -- #0024d6
cyan = hsl(200, 100, 62), -- #3dbeff
cyan100 = hsl(201, 100, 80), -- #99ddff
cyan300 = hsl(200, 100, 68), -- #5cc9ff
cyan500 = hsl(200, 100, 62), -- #3dbeff
cyan700 = hsl(207, 100, 53), -- #0fafff
cyan900 = hsl(208, 100, 48), -- #00a3f5
green = hsl(260, 100, 68), -- #925cff
green100 = hsl(282, 100, 84), -- #e7adff
green300 = hsl(268, 100, 76), -- #da85ff
green500 = hsl(260, 100, 68), -- #925cff
green700 = hsl(260, 100, 20), -- #470066
green900 = hsl(260, 100, 10), -- #240033
bg = hsl(0, 0, 11), -- #1c1c1c
bg_highlight = hsl(0, 0, 8), -- #141414
fg = hsl(0, 0, 95), -- #f2f2f2
}
M.golden = {
none = "NONE",
base04 = hsl(0, 0, 4), -- #0a0a0a
base03 = hsl(0, 0, 8), -- #141414
base02 = hsl(0, 0, 11), -- #1c1c1c
base01 = hsl(0, 0, 67), -- #ababab
base00 = hsl(0, 0, 40), -- #666666
base0 = hsl(0, 0, 95), -- #f2f2f2
base1 = hsl(200, 100, 58), -- #29b8ff
base2 = hsl(0, 0, 35), -- #595959
base3 = hsl(0, 0, 78), -- #c7c7c7
base4 = hsl(0, 0, 100), -- #ffffff
yellow = hsl(245, 100, 68), -- #695cff
yellow100 = hsl(245, 100, 78), -- #988fff
yellow300 = hsl(245, 100, 73), -- #8175ff
yellow500 = hsl(245, 100, 68), -- #695cff
yellow700 = hsl(245, 100, 63), -- #5242ff
yellow900 = hsl(246, 100, 58), -- #3b29ff
orange = hsl(257, 100, 58), -- #6529ff
orange100 = hsl(257, 100, 80), -- #b699ff
orange300 = hsl(257, 100, 63), -- #7842ff
orange500 = hsl(257, 100, 58), -- #6529ff
orange700 = hsl(257, 100, 53), -- #530fff
orange900 = hsl(257, 100, 48), -- #4500f5
red = hsl(275, 100, 68), -- #ba5aff
red100 = hsl(275, 100, 80), -- #d499ff
red300 = hsl(275, 100, 72), -- #c370ff
red500 = hsl(275, 100, 68), -- #bb5cff
red700 = hsl(275, 100, 47), -- #8c00f0
red900 = hsl(275, 100, 42), -- #7d00d6
magenta = hsl(9, 100, 57), -- #e6583e
magenta100 = hsl(9, 100, 80), -- #ffa899
magenta300 = hsl(9, 100, 73), -- #ff8a75
magenta500 = hsl(9, 100, 57), -- #e6583e
magenta700 = hsl(9, 100, 47), -- #f02400
magenta900 = hsl(9, 100, 42), -- #d62000
violet = hsl(215, 100, 62), -- #3d8eff
violet100 = hsl(214, 100, 80), -- #99c3ff
violet300 = hsl(215, 100, 70), -- #66a6ff
violet500 = hsl(215, 100, 62), -- #3d8eff
violet700 = hsl(215, 100, 50), -- #006aff
violet900 = hsl(215, 100, 42), -- #0059d6
blue = hsl(41, 100, 50), -- #ffb000
blue100 = hsl(230, 100, 82), -- #ffe2a3
blue300 = hsl(230, 100, 76), -- #ffd885
blue500 = hsl(230, 100, 50), -- #ffb000
blue700 = hsl(230, 100, 47), -- #f0a400
blue900 = hsl(230, 100, 42), -- #d69200
cyan = hsl(200, 100, 62), -- #5ac8ff
cyan100 = hsl(201, 100, 80), -- #99ddff
cyan300 = hsl(200, 100, 68), -- #5cc9ff
cyan500 = hsl(200, 100, 62), -- #3dbeff
cyan700 = hsl(207, 100, 53), -- #0fafff
cyan900 = hsl(208, 100, 48), -- #00a3f5
green = hsl(260, 100, 68), -- #925cff
green100 = hsl(282, 100, 84), -- #e7adff
green300 = hsl(268, 100, 76), -- #da85ff
green500 = hsl(260, 100, 68), -- #925cff
green700 = hsl(260, 100, 20), -- #470066
green900 = hsl(260, 100, 10), -- #240033
bg = hsl(0, 0, 11), -- #1c1c1c
bg_highlight = hsl(0, 0, 8), -- #141414
fg = hsl(0, 0, 95), -- #f2f2f2
}
---@return ColorScheme
function M.setup(opts)
opts = opts or {}
local config = require("dullahan.config")
local style = config.is_white() and config.options.light_style or config.options.style
local palette = M[style] or {}
if type(palette) == "function" then
---@type Palette
palette = palette()
end
-- Color Palette
---@class ColorScheme: Palette
local colors = vim.tbl_deep_extend("force", vim.deepcopy(M.default), palette)
util.bg = colors.bg
util.day_brightness = config.options.day_brightness
colors.black = util.darken(colors.bg, 0.8, "#000000")
colors.border = colors.black
-- Popups and statusline always get a dark background
colors.bg_popup = colors.base04
colors.bg_statusline = colors.base03
-- Sidebar and Floats are configurable
colors.bg_sidebar = config.options.styles.sidebars == "transparent" and colors.none
or config.options.styles.sidebars == "dark" and colors.base04
or colors.bg
colors.bg_float = config.options.styles.floats == "transparent" and colors.none
or config.options.styles.floats == "dark" and colors.base04
or colors.bg
-- colors.fg_float = config.options.styles.floats == "dark" and colors.base01 or colors.fg
colors.fg_float = colors.fg
colors.error = colors.red500
colors.warning = colors.yellow500
colors.info = colors.blue500
colors.hint = colors.cyan500
colors.todo = colors.violet500
config.options.on_colors(colors)
if opts.transform and config.is_white() then
util.invert_colors(colors)
end
return colors
end
return M