Nothing Special   »   [go: up one dir, main page]

Skip to content

Commit

Permalink
Move some stuff around, remove extra println, and clean up code style…
Browse files Browse the repository at this point in the history
… a bit
  • Loading branch information
ttacon committed Jul 19, 2014
1 parent ea7cdb0 commit e693358
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion colorize/colorize.go → colorize.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ type color struct {

func (c *color) WithBackground(col Color) Color {
bg := col.Foreground(nil)
fmt.Println(bg)
c.Background(&bg)
return c
}
Expand Down
8 changes: 4 additions & 4 deletions examples/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package main

import (
"fmt"

"github.com/ttacon/goji-colorize/colorize"
)

func main() {
fmt.Println(colorize.Red, "hello", colorize.Cyan, "world", colorize.Reset)
fmt.Println(colorize.Magenta.Color("hello, world"))

fmt.Printf("%s%s%s\n", colorize.Blue.WithBackground(colorize.White), "Hello, World!", colorize.Reset)
fmt.Println(colorize.Red, "Writing in colors", colorize.Cyan, "is so much fun", colorize.Reset)
fmt.Println(colorize.Magenta.Color("You can use colors to color specific phrases"))
fmt.Printf("%s%s%s\n", colorize.Blue.WithBackground(colorize.White), "And they also have backgrounds!", colorize.Reset)
}

0 comments on commit e693358

Please sign in to comment.