From 94537c1fb8b3957f8a471fe9f5321aaaa4b9b915 Mon Sep 17 00:00:00 2001 From: probandula Date: Thu, 3 Nov 2016 11:34:41 +0100 Subject: [PATCH] few fixes --- cmd/figlet4go/figlet4go.go | 2 +- color.go | 22 +++++++++++----------- parser.go | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cmd/figlet4go/figlet4go.go b/cmd/figlet4go/figlet4go.go index 5629de6..17edabd 100644 --- a/cmd/figlet4go/figlet4go.go +++ b/cmd/figlet4go/figlet4go.go @@ -15,7 +15,7 @@ var ( fontpath *string = flag.String("fontpath", "", "Font path to load fonts from") colors *string = flag.String("colors", "", "Character colors separated by ';'\n\tPossible colors: black, red, green, yellow, blue, magenta, cyan, white, or any hexcode (f.e. '885DBA')") parser *string = flag.String("parser", "terminal", "Parser to use\tPossible parsers: terminal (default), html") - file *string = flag.String("file", "", "File to write to") + file *string = flag.String("file", "", "File to write to") ) func main() { diff --git a/color.go b/color.go index 524918e..78f3b93 100644 --- a/color.go +++ b/color.go @@ -24,15 +24,15 @@ var ( // TrueColor lookalikes for displaying AnsiColor f.e. with the HTML parser // Colors based on http://clrs.cc/ // "TrueColorForAnsiColor" -var tcfac map[AnsiColor]TrueColor = map[AnsiColor]TrueColor{ - ColorBlack: {0, 0, 0}, - ColorRed: {255, 65, 54}, - ColorGreen: {149, 189, 64}, - ColorYellow: {255, 220, 0}, - ColorBlue: {0, 116, 217}, - ColorMagenta: {177, 13, 201}, - ColorCyan: {105, 206, 245}, - ColorWhite: {255, 255, 255}, +var tcfac map[*AnsiColor]TrueColor = map[*AnsiColor]TrueColor{ + &ColorBlack: {0, 0, 0}, + &ColorRed: {255, 65, 54}, + &ColorGreen: {149, 189, 64}, + &ColorYellow: {255, 220, 0}, + &ColorBlue: {0, 116, 217}, + &ColorMagenta: {177, 13, 201}, + &ColorCyan: {105, 206, 245}, + &ColorWhite: {255, 255, 255}, } // Color has a pre- and a suffix @@ -104,7 +104,7 @@ func (ac AnsiColor) getPrefix(p Parser) string { case "html": // Get the TrueColor for the AnsiColor - tc := tcfac[ac] + tc := tcfac[&ac] return tc.getPrefix(p) } @@ -121,7 +121,7 @@ func (ac AnsiColor) getSuffix(p Parser) string { case "html": // Get the TrueColor for the AnsiColor - tc := tcfac[ac] + tc := tcfac[&ac] return tc.getSuffix(p) } diff --git a/parser.go b/parser.go index 90f4f06..670cea1 100644 --- a/parser.go +++ b/parser.go @@ -31,4 +31,4 @@ func GetParser(key string) (*Parser, error) { return nil, errors.New("Invalid parser key: " + key) } return &parser, nil -} \ No newline at end of file +}