forked from MichaelMure/go-term-markdown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.go
37 lines (30 loc) · 938 Bytes
/
options.go
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
package markdown
import "github.com/eliukblau/pixterm/pkg/ansimage"
type Options func(r *renderer)
// DitheringMode type is used for image scale dithering mode constants.
type DitheringMode uint8
const (
NoDithering = DitheringMode(iota)
DitheringWithBlocks
DitheringWithChars
)
// Dithering mode for ansimage
// Default is fine directly through a terminal
// DitheringWithBlocks is recommended if a terminal UI library is used
func WithImageDithering(mode DitheringMode) Options {
return func(r *renderer) {
r.imageDithering = ansimage.DitheringMode(mode)
}
}
// Use a custom collection of ANSI colors for the headings
func WithHeadingShades(shades []shadeFmt) Options {
return func(r *renderer) {
r.headingShade = shade(shades)
}
}
// Use a custom collection of ANSI colors for the blockquotes
func WithBlockquoteShades(shades []shadeFmt) Options {
return func(r *renderer) {
r.blockQuoteShade = shade(shades)
}
}