@@ -14,10 +14,7 @@ local scale = primitives.scale
14
14
C .WHITE = C (scale .white )
15
15
C .BLACK = C (scale .black )
16
16
C .BG = C (scale .gray [7 ])
17
-
18
- local function alpha (color , a )
19
- return color :alpha_blend (a ):to_css ()
20
- end
17
+ local BG = C (scale .gray [7 ])
21
18
22
19
local palette = {
23
20
scale = scale ,
@@ -52,86 +49,86 @@ local palette = {
52
49
border = {
53
50
default = scale .gray [9 ],
54
51
muted = scale .gray [8 ],
55
- subtle = alpha (C .from_rgba (240 , 246 , 252 , 1 ), 0.1 ),
52
+ subtle = BG : blend (C .from_rgba (240 , 246 , 252 , 1 ), 0.1 ): to_css ( ),
56
53
},
57
54
58
55
neutral = {
59
56
emphasis_plus = scale .gray [5 ],
60
57
emphasis = scale .gray [5 ],
61
- muted = alpha (C .from_rgba (110 , 118 , 129 , 1 ), 0.4 ),
62
- subtle = alpha (C .from_rgba (110 , 118 , 129 , 1 ), 0.1 ),
58
+ muted = BG : blend (C .from_rgba (110 , 118 , 129 , 1 ), 0.4 ): to_css ( ),
59
+ subtle = BG : blend (C .from_rgba (110 , 118 , 129 , 1 ), 0.1 ): to_css ( ),
63
60
},
64
61
65
62
accent = {
66
63
fg = ' #2f81f7' ,
67
64
emphasis = scale .blue [6 ],
68
- muted = alpha (C .from_rgba (56 , 139 , 253 , 1 ), 0.4 ),
69
- subtle = alpha (C .from_rgba (56 , 139 , 253 , 1 ), 0.15 ),
65
+ muted = BG : blend (C .from_rgba (56 , 139 , 253 , 1 ), 0.4 ): to_css ( ),
66
+ subtle = BG : blend (C .from_rgba (56 , 139 , 253 , 1 ), 0.15 ): to_css ( ),
70
67
},
71
68
72
69
success = {
73
70
fg = scale .green [4 ],
74
71
emphasis = scale .green [6 ],
75
- muted = alpha (C .from_rgba (46 , 160 , 67 , 1 ), 0.4 ),
76
- subtle = alpha (C .from_rgba (46 , 160 , 67 , 1 ), 0.15 ),
72
+ muted = BG : blend (C .from_rgba (46 , 160 , 67 , 1 ), 0.4 ): to_css ( ),
73
+ subtle = BG : blend (C .from_rgba (46 , 160 , 67 , 1 ), 0.15 ): to_css ( ),
77
74
},
78
75
79
76
attention = {
80
77
fg = scale .yellow [4 ],
81
78
emphasis = scale .yellow [6 ],
82
- muted = alpha (C .from_rgba (187 , 128 , 9 , 1 ), 0.4 ),
83
- subtle = alpha (C .from_rgba (187 , 128 , 9 , 1 ), 0.15 ),
79
+ muted = BG : blend (C .from_rgba (187 , 128 , 9 , 1 ), 0.4 ): to_css ( ),
80
+ subtle = BG : blend (C .from_rgba (187 , 128 , 9 , 1 ), 0.15 ): to_css ( ),
84
81
},
85
82
86
83
severe = {
87
84
fg = scale .orange [5 ],
88
85
emphasis = scale .orange [6 ],
89
- muted = alpha (C .from_rgba (219 , 109 , 40 , 1 ), 0.4 ),
90
- subtle = alpha (C .from_rgba (219 , 109 , 40 , 1 ), 0.1 ),
86
+ muted = BG : blend (C .from_rgba (219 , 109 , 40 , 1 ), 0.4 ): to_css ( ),
87
+ subtle = BG : blend (C .from_rgba (219 , 109 , 40 , 1 ), 0.1 ): to_css ( ),
91
88
},
92
89
93
90
danger = {
94
91
fg = scale .red [5 ],
95
92
emphasis = scale .red [6 ],
96
- muted = alpha (C .from_rgba (248 , 81 , 73 , 1 ), 0.4 ),
97
- subtle = alpha (C .from_rgba (248 , 81 , 73 , 1 ), 0.1 ),
93
+ muted = BG : blend (C .from_rgba (248 , 81 , 73 , 1 ), 0.4 ): to_css ( ),
94
+ subtle = BG : blend (C .from_rgba (248 , 81 , 73 , 1 ), 0.1 ): to_css ( ),
98
95
},
99
96
100
97
open = {
101
98
fg = scale .green [4 ],
102
99
emphasis = scale .green [6 ],
103
- muted = alpha (C .from_rgba (46 , 160 , 67 , 1 ), 0.4 ),
104
- subtle = alpha (C .from_rgba (46 , 160 , 67 , 1 ), 0.15 ),
100
+ muted = BG : blend (C .from_rgba (46 , 160 , 67 , 1 ), 0.4 ): to_css ( ),
101
+ subtle = BG : blend (C .from_rgba (46 , 160 , 67 , 1 ), 0.15 ): to_css ( ),
105
102
},
106
103
107
104
done = {
108
105
fg = scale .purple [5 ],
109
106
emphasis = scale .purple [6 ],
110
- muted = alpha (C .from_rgba (163 , 113 , 247 , 1 ), 0.4 ),
111
- subtle = alpha (C .from_rgba (163 , 113 , 247 , 1 ), 0.1 ),
107
+ muted = BG : blend (C .from_rgba (163 , 113 , 247 , 1 ), 0.4 ): to_css ( ),
108
+ subtle = BG : blend (C .from_rgba (163 , 113 , 247 , 1 ), 0.1 ): to_css ( ),
112
109
},
113
110
114
111
closed = {
115
112
fg = scale .red [5 ],
116
113
emphasis = scale .red [6 ],
117
- muted = alpha (C .from_rgba (248 , 81 , 73 , 1 ), 0.4 ),
118
- subtle = alpha (C .from_rgba (248 , 81 , 73 , 1 ), 0.15 ),
114
+ muted = BG : blend (C .from_rgba (248 , 81 , 73 , 1 ), 0.4 ): to_css ( ),
115
+ subtle = BG : blend (C .from_rgba (248 , 81 , 73 , 1 ), 0.15 ): to_css ( ),
119
116
},
120
117
121
118
sponsors = {
122
119
fg = scale .pink [5 ],
123
120
emphasis = scale .pink [6 ],
124
- muted = alpha (C .from_rgba (219 , 97 , 162 , 1 ), 0.4 ),
125
- subtle = alpha (C .from_rgba (219 , 97 , 162 , 1 ), 0.1 ),
121
+ muted = BG : blend (C .from_rgba (219 , 97 , 162 , 1 ), 0.4 ): to_css ( ),
122
+ subtle = BG : blend (C .from_rgba (219 , 97 , 162 , 1 ), 0.1 ): to_css ( ),
126
123
},
127
124
}
128
125
129
126
local function generate_spec (pal )
130
127
-- stylua: ignore start
131
128
local spec = {
132
- bg0 = alpha (C (pal .canvas .inset ), 0.75 ), -- Dark bg (popup and float)
129
+ bg0 = BG : blend (C (pal .canvas .inset ), 0.75 ): to_css (), -- Dark bg (popup and float)
133
130
bg1 = pal .canvas .default , -- Default bg
134
- bg2 = alpha (C (pal .neutral .emphasis ), 0.1 ), -- Lighter bg (colorcolumn Folds)
131
+ bg2 = BG : blend (C (pal .neutral .emphasis ), 0.1 ): to_css (), -- Lighter bg (colorcolumn Folds)
135
132
bg3 = pal .scale .gray [6 ], -- Lighter bg (cursor line)
136
133
bg4 = pal .scale .gray [4 ], -- Conceal
137
134
@@ -140,9 +137,9 @@ local function generate_spec(pal)
140
137
fg2 = pal .fg .muted , -- Darker fg (status line)
141
138
fg3 = pal .scale .gray [5 ], -- Darker fg (line numbers, fold columns)
142
139
143
- sel0 = alpha (C (pal .accent .fg ), 0.30 ), -- Visual selection bg
144
- sel1 = alpha (C (pal .accent .muted ), 0.90 ), -- Popup sel bg
145
- sel2 = alpha (C (pal .scale .yellow [1 ]), 0.20 ), -- Search bg
140
+ sel0 = BG : blend (C (pal .accent .fg ), 0.30 ): to_css (), -- Visual selection bg
141
+ sel1 = BG : blend (C (pal .accent .muted ), 0.90 ): to_css (), -- Popup sel bg
142
+ sel2 = BG : blend (C (pal .scale .yellow [1 ]), 0.20 ): to_css (), -- Search bg
146
143
}
147
144
148
145
spec .syntax = {
@@ -178,16 +175,16 @@ local function generate_spec(pal)
178
175
}
179
176
180
177
spec .diag_bg = {
181
- error = C ( spec . bg1 ) :blend (C (spec .diag .error ), 0.15 ):to_css (),
182
- warn = C ( spec . bg1 ) :blend (C (spec .diag .warn ), 0.15 ):to_css (),
183
- info = C ( spec . bg1 ) :blend (C (spec .diag .info ), 0.15 ):to_css (),
184
- hint = C ( spec . bg1 ) :blend (C (spec .diag .hint ), 0.15 ):to_css (),
178
+ error = BG :blend (C (spec .diag .error ), 0.15 ):to_css (),
179
+ warn = BG :blend (C (spec .diag .warn ), 0.15 ):to_css (),
180
+ info = BG :blend (C (spec .diag .info ), 0.15 ):to_css (),
181
+ hint = BG :blend (C (spec .diag .hint ), 0.15 ):to_css (),
185
182
}
186
183
187
184
spec .diff = {
188
- add = alpha (C (pal .scale .green [6 ]), 0.15 ),
189
- delete = alpha (C (pal .scale .red [6 ]), 0.15 ),
190
- change = alpha (C (pal .scale .yellow [6 ]), 0.15 ),
185
+ add = BG : blend (C (pal .scale .green [6 ]), 0.15 ): to_css ( ),
186
+ delete = BG : blend (C (pal .scale .red [6 ]), 0.15 ): to_css ( ),
187
+ change = BG : blend (C (pal .scale .yellow [6 ]), 0.15 ): to_css ( ),
191
188
text = spec .fg0
192
189
}
193
190
0 commit comments