summaryrefslogtreecommitdiff
path: root/vendor/github.com/morikuni/aec/builder.go
blob: 13bd002d4e30e389825b47c441e8f45fe7d15aaf (plain)
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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
package aec

// Builder is a lightweight syntax to construct customized ANSI.
type Builder struct {
	ANSI ANSI
}

// EmptyBuilder is an initialized Builder.
var EmptyBuilder *Builder

// NewBuilder creates a Builder from existing ANSI.
func NewBuilder(a ...ANSI) *Builder {
	return &Builder{concat(a)}
}

// With is a syntax for With.
func (builder *Builder) With(a ...ANSI) *Builder {
	return NewBuilder(builder.ANSI.With(a...))
}

// Up is a syntax for Up.
func (builder *Builder) Up(n uint) *Builder {
	return builder.With(Up(n))
}

// Down is a syntax for Down.
func (builder *Builder) Down(n uint) *Builder {
	return builder.With(Down(n))
}

// Right is a syntax for Right.
func (builder *Builder) Right(n uint) *Builder {
	return builder.With(Right(n))
}

// Left is a syntax for Left.
func (builder *Builder) Left(n uint) *Builder {
	return builder.With(Left(n))
}

// NextLine is a syntax for NextLine.
func (builder *Builder) NextLine(n uint) *Builder {
	return builder.With(NextLine(n))
}

// PreviousLine is a syntax for PreviousLine.
func (builder *Builder) PreviousLine(n uint) *Builder {
	return builder.With(PreviousLine(n))
}

// Column is a syntax for Column.
func (builder *Builder) Column(col uint) *Builder {
	return builder.With(Column(col))
}

// Position is a syntax for Position.
func (builder *Builder) Position(row, col uint) *Builder {
	return builder.With(Position(row, col))
}

// EraseDisplay is a syntax for EraseDisplay.
func (builder *Builder) EraseDisplay(m EraseMode) *Builder {
	return builder.With(EraseDisplay(m))
}

// EraseLine is a syntax for EraseLine.
func (builder *Builder) EraseLine(m EraseMode) *Builder {
	return builder.With(EraseLine(m))
}

// ScrollUp is a syntax for ScrollUp.
func (builder *Builder) ScrollUp(n int) *Builder {
	return builder.With(ScrollUp(n))
}

// ScrollDown is a syntax for ScrollDown.
func (builder *Builder) ScrollDown(n int) *Builder {
	return builder.With(ScrollDown(n))
}

// Save is a syntax for Save.
func (builder *Builder) Save() *Builder {
	return builder.With(Save)
}

// Restore is a syntax for Restore.
func (builder *Builder) Restore() *Builder {
	return builder.With(Restore)
}

// Hide is a syntax for Hide.
func (builder *Builder) Hide() *Builder {
	return builder.With(Hide)
}

// Show is a syntax for Show.
func (builder *Builder) Show() *Builder {
	return builder.With(Show)
}

// Report is a syntax for Report.
func (builder *Builder) Report() *Builder {
	return builder.With(Report)
}

// Bold is a syntax for Bold.
func (builder *Builder) Bold() *Builder {
	return builder.With(Bold)
}

// Faint is a syntax for Faint.
func (builder *Builder) Faint() *Builder {
	return builder.With(Faint)
}

// Italic is a syntax for Italic.
func (builder *Builder) Italic() *Builder {
	return builder.With(Italic)
}

// Underline is a syntax for Underline.
func (builder *Builder) Underline() *Builder {
	return builder.With(Underline)
}

// BlinkSlow is a syntax for BlinkSlow.
func (builder *Builder) BlinkSlow() *Builder {
	return builder.With(BlinkSlow)
}

// BlinkRapid is a syntax for BlinkRapid.
func (builder *Builder) BlinkRapid() *Builder {
	return builder.With(BlinkRapid)
}

// Inverse is a syntax for Inverse.
func (builder *Builder) Inverse() *Builder {
	return builder.With(Inverse)
}

// Conceal is a syntax for Conceal.
func (builder *Builder) Conceal() *Builder {
	return builder.With(Conceal)
}

// CrossOut is a syntax for CrossOut.
func (builder *Builder) CrossOut() *Builder {
	return builder.With(CrossOut)
}

// BlackF is a syntax for BlackF.
func (builder *Builder) BlackF() *Builder {
	return builder.With(BlackF)
}

// RedF is a syntax for RedF.
func (builder *Builder) RedF() *Builder {
	return builder.With(RedF)
}

// GreenF is a syntax for GreenF.
func (builder *Builder) GreenF() *Builder {
	return builder.With(GreenF)
}

// YellowF is a syntax for YellowF.
func (builder *Builder) YellowF() *Builder {
	return builder.With(YellowF)
}

// BlueF is a syntax for BlueF.
func (builder *Builder) BlueF() *Builder {
	return builder.With(BlueF)
}

// MagentaF is a syntax for MagentaF.
func (builder *Builder) MagentaF() *Builder {
	return builder.With(MagentaF)
}

// CyanF is a syntax for CyanF.
func (builder *Builder) CyanF() *Builder {
	return builder.With(CyanF)
}

// WhiteF is a syntax for WhiteF.
func (builder *Builder) WhiteF() *Builder {
	return builder.With(WhiteF)
}

// DefaultF is a syntax for DefaultF.
func (builder *Builder) DefaultF() *Builder {
	return builder.With(DefaultF)
}

// BlackB is a syntax for BlackB.
func (builder *Builder) BlackB() *Builder {
	return builder.With(BlackB)
}

// RedB is a syntax for RedB.
func (builder *Builder) RedB() *Builder {
	return builder.With(RedB)
}

// GreenB is a syntax for GreenB.
func (builder *Builder) GreenB() *Builder {
	return builder.With(GreenB)
}

// YellowB is a syntax for YellowB.
func (builder *Builder) YellowB() *Builder {
	return builder.With(YellowB)
}

// BlueB is a syntax for BlueB.
func (builder *Builder) BlueB() *Builder {
	return builder.With(BlueB)
}

// MagentaB is a syntax for MagentaB.
func (builder *Builder) MagentaB() *Builder {
	return builder.With(MagentaB)
}

// CyanB is a syntax for CyanB.
func (builder *Builder) CyanB() *Builder {
	return builder.With(CyanB)
}

// WhiteB is a syntax for WhiteB.
func (builder *Builder) WhiteB() *Builder {
	return builder.With(WhiteB)
}

// DefaultB is a syntax for DefaultB.
func (builder *Builder) DefaultB() *Builder {
	return builder.With(DefaultB)
}

// Frame is a syntax for Frame.
func (builder *Builder) Frame() *Builder {
	return builder.With(Frame)
}

// Encircle is a syntax for Encircle.
func (builder *Builder) Encircle() *Builder {
	return builder.With(Encircle)
}

// Overline is a syntax for Overline.
func (builder *Builder) Overline() *Builder {
	return builder.With(Overline)
}

// LightBlackF is a syntax for LightBlueF.
func (builder *Builder) LightBlackF() *Builder {
	return builder.With(LightBlackF)
}

// LightRedF is a syntax for LightRedF.
func (builder *Builder) LightRedF() *Builder {
	return builder.With(LightRedF)
}

// LightGreenF is a syntax for LightGreenF.
func (builder *Builder) LightGreenF() *Builder {
	return builder.With(LightGreenF)
}

// LightYellowF is a syntax for LightYellowF.
func (builder *Builder) LightYellowF() *Builder {
	return builder.With(LightYellowF)
}

// LightBlueF is a syntax for LightBlueF.
func (builder *Builder) LightBlueF() *Builder {
	return builder.With(LightBlueF)
}

// LightMagentaF is a syntax for LightMagentaF.
func (builder *Builder) LightMagentaF() *Builder {
	return builder.With(LightMagentaF)
}

// LightCyanF is a syntax for LightCyanF.
func (builder *Builder) LightCyanF() *Builder {
	return builder.With(LightCyanF)
}

// LightWhiteF is a syntax for LightWhiteF.
func (builder *Builder) LightWhiteF() *Builder {
	return builder.With(LightWhiteF)
}

// LightBlackB is a syntax for LightBlackB.
func (builder *Builder) LightBlackB() *Builder {
	return builder.With(LightBlackB)
}

// LightRedB is a syntax for LightRedB.
func (builder *Builder) LightRedB() *Builder {
	return builder.With(LightRedB)
}

// LightGreenB is a syntax for LightGreenB.
func (builder *Builder) LightGreenB() *Builder {
	return builder.With(LightGreenB)
}

// LightYellowB is a syntax for LightYellowB.
func (builder *Builder) LightYellowB() *Builder {
	return builder.With(LightYellowB)
}

// LightBlueB is a syntax for LightBlueB.
func (builder *Builder) LightBlueB() *Builder {
	return builder.With(LightBlueB)
}

// LightMagentaB is a syntax for LightMagentaB.
func (builder *Builder) LightMagentaB() *Builder {
	return builder.With(LightMagentaB)
}

// LightCyanB is a syntax for LightCyanB.
func (builder *Builder) LightCyanB() *Builder {
	return builder.With(LightCyanB)
}

// LightWhiteB is a syntax for LightWhiteB.
func (builder *Builder) LightWhiteB() *Builder {
	return builder.With(LightWhiteB)
}

// Color3BitF is a syntax for Color3BitF.
func (builder *Builder) Color3BitF(c RGB3Bit) *Builder {
	return builder.With(Color3BitF(c))
}

// Color3BitB is a syntax for Color3BitB.
func (builder *Builder) Color3BitB(c RGB3Bit) *Builder {
	return builder.With(Color3BitB(c))
}

// Color8BitF is a syntax for Color8BitF.
func (builder *Builder) Color8BitF(c RGB8Bit) *Builder {
	return builder.With(Color8BitF(c))
}

// Color8BitB is a syntax for Color8BitB.
func (builder *Builder) Color8BitB(c RGB8Bit) *Builder {
	return builder.With(Color8BitB(c))
}

// FullColorF is a syntax for FullColorF.
func (builder *Builder) FullColorF(r, g, b uint8) *Builder {
	return builder.With(FullColorF(r, g, b))
}

// FullColorB is a syntax for FullColorB.
func (builder *Builder) FullColorB(r, g, b uint8) *Builder {
	return builder.With(FullColorB(r, g, b))
}

// RGB3BitF is a syntax for Color3BitF with NewRGB3Bit.
func (builder *Builder) RGB3BitF(r, g, b uint8) *Builder {
	return builder.Color3BitF(NewRGB3Bit(r, g, b))
}

// RGB3BitB is a syntax for Color3BitB with NewRGB3Bit.
func (builder *Builder) RGB3BitB(r, g, b uint8) *Builder {
	return builder.Color3BitB(NewRGB3Bit(r, g, b))
}

// RGB8BitF is a syntax for Color8BitF with NewRGB8Bit.
func (builder *Builder) RGB8BitF(r, g, b uint8) *Builder {
	return builder.Color8BitF(NewRGB8Bit(r, g, b))
}

// RGB8BitB is a syntax for Color8BitB with NewRGB8Bit.
func (builder *Builder) RGB8BitB(r, g, b uint8) *Builder {
	return builder.Color8BitB(NewRGB8Bit(r, g, b))
}

func init() {
	EmptyBuilder = &Builder{empty}
}