Improved tests
This commit is contained in:
parent
7db9e36587
commit
d5335f4bad
4 changed files with 19 additions and 12 deletions
3
Color.go
3
Color.go
|
@ -24,6 +24,7 @@ func RGB(r Component, g Component, b Component) Color {
|
|||
func (c Color) Fprint(writer io.Writer, text string) {
|
||||
if !Terminal {
|
||||
fmt.Fprint(writer, text)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Fprintf(writer, format, byte(c.R*255), byte(c.G*255), byte(c.B*255), text)
|
||||
|
@ -33,6 +34,7 @@ func (c Color) Fprint(writer io.Writer, text string) {
|
|||
func (c Color) Print(text string) {
|
||||
if !Terminal {
|
||||
fmt.Print(text)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Printf(format, byte(c.R*255), byte(c.G*255), byte(c.B*255), text)
|
||||
|
@ -42,6 +44,7 @@ func (c Color) Print(text string) {
|
|||
func (c Color) Println(text string) {
|
||||
if !Terminal {
|
||||
fmt.Println(text)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Printf(formatLine, byte(c.R*255), byte(c.G*255), byte(c.B*255), text)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue