From b87b825ef9951f1653b0ca0b4345d55dbf2b9e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Nu=C8=9Biu?= Date: Sat, 25 Nov 2017 15:53:54 +0200 Subject: [PATCH] Adding color support for the pic command --- README.md | 1 + server/server/commands.go | 2 +- server/server/config.go | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 49e3bb3..2fa0464 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ Sample Configuration File: "maxDirDepth": 30, "absoluteServePath": "/Users/denis/Dropbox/Pictures/CuteAvatars", "pic": { + "color": false, "x": 0, "y": 0 } diff --git a/server/server/commands.go b/server/server/commands.go index 588096d..f12890e 100644 --- a/server/server/commands.go +++ b/server/server/commands.go @@ -24,7 +24,7 @@ func SendAsciiPic(c Client, path string) error { opt := ascii.Options{ Width: viper.GetInt("pic.x"), Height: viper.GetInt("pic.y"), - Color: false, + Color: viper.GetBool("pic.color"), Invert: false, Flipx: false, Flipy: false} diff --git a/server/server/config.go b/server/server/config.go index 84ba379..60e43a7 100644 --- a/server/server/config.go +++ b/server/server/config.go @@ -34,6 +34,7 @@ func setDefaultConfiguration() { viper.SetDefault("absoluteServePath", "./") viper.SetDefault("pic.x", 0) viper.SetDefault("pic.y", 0) + viper.SetDefault("pic.color", false) } // InitializedConfiguration initializes the configuration for the application.