From 1536418772e4068ac114b3c8097f152ed54ff267 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 17 Dec 2016 13:35:42 +0100 Subject: Cleanup --- main.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/main.go b/main.go index b5b0174..2e2fae4 100644 --- a/main.go +++ b/main.go @@ -14,21 +14,6 @@ import ( plist "github.com/DHowett/go-plist" ) -type Color struct { - Alpha float64 `plist:"Alpha Component"` - Red float64 `plist:"Red Component"` - Green float64 `plist:"Green Component"` - Blue float64 `plist:"Blue Component"` - Space string `plist:"Color Space"` -} - -func (c Color) String() string { - r := int(math.MaxUint8 * c.Red) - g := int(math.MaxUint8 * c.Green) - b := int(math.MaxUint8 * c.Blue) - return fmt.Sprintf("#%02x%02x%02x", r, g, b) -} - const t = `! Color scheme: {{.Name}} *VT100*foreground: {{.Foreground}} *VT100*background: {{.Background}} @@ -93,6 +78,21 @@ type Scheme struct { Selection Color `plist:"Selection Color"` } +type Color struct { + Alpha float64 `plist:"Alpha Component"` + Red float64 `plist:"Red Component"` + Green float64 `plist:"Green Component"` + Blue float64 `plist:"Blue Component"` + Space string `plist:"Color Space"` +} + +func (c Color) String() string { + r := int(math.MaxUint8 * c.Red) + g := int(math.MaxUint8 * c.Green) + b := int(math.MaxUint8 * c.Blue) + return fmt.Sprintf("#%02x%02x%02x", r, g, b) +} + func name(s string) string { return strings.TrimSuffix(filepath.Base(s), filepath.Ext(s)) } -- cgit v1.2.3