Adding color support for the pic command

This commit is contained in:
Denis-Cosmin Nutiu 2017-11-25 15:53:54 +02:00
parent a1a338d086
commit b87b825ef9
3 changed files with 3 additions and 1 deletions

View file

@ -23,6 +23,7 @@ Sample Configuration File:
"maxDirDepth": 30, "maxDirDepth": 30,
"absoluteServePath": "/Users/denis/Dropbox/Pictures/CuteAvatars", "absoluteServePath": "/Users/denis/Dropbox/Pictures/CuteAvatars",
"pic": { "pic": {
"color": false,
"x": 0, "x": 0,
"y": 0 "y": 0
} }

View file

@ -24,7 +24,7 @@ func SendAsciiPic(c Client, path string) error {
opt := ascii.Options{ opt := ascii.Options{
Width: viper.GetInt("pic.x"), Width: viper.GetInt("pic.x"),
Height: viper.GetInt("pic.y"), Height: viper.GetInt("pic.y"),
Color: false, Color: viper.GetBool("pic.color"),
Invert: false, Invert: false,
Flipx: false, Flipx: false,
Flipy: false} Flipy: false}

View file

@ -34,6 +34,7 @@ func setDefaultConfiguration() {
viper.SetDefault("absoluteServePath", "./") viper.SetDefault("absoluteServePath", "./")
viper.SetDefault("pic.x", 0) viper.SetDefault("pic.x", 0)
viper.SetDefault("pic.y", 0) viper.SetDefault("pic.y", 0)
viper.SetDefault("pic.color", false)
} }
// InitializedConfiguration initializes the configuration for the application. // InitializedConfiguration initializes the configuration for the application.