Improved tests
This commit is contained in:
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)
|
||||
|
Reference in New Issue
Block a user