Skip to content

Commit 963c6e0

Browse files
committed
Add Colorize for those who prefer it
1 parent 05f2b82 commit 963c6e0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func main() {
2525

2626
### Function and variable
2727

28-
You can use the `Ize(color, message)` function in conjunction with a variable:
28+
You can use the `Colorize(color, message)`/`Ize(color, message)` function in conjunction with a variable:
2929

3030
```go
3131
package main
@@ -34,16 +34,20 @@ import "github.com/TwinProduction/go-color"
3434

3535
func main() {
3636
println(color.Ize(color.Red, "Something something something"))
37+
// Or if you prefer the longer version
38+
println(color.Colorize(color.Red, "Something something something"))
3739
}
3840
```
3941

4042
Unlike the method above, using this function will automatically prepend `color.Reset` at the
4143
end of your message.
4244

45+
Because I felt reading `color.Ize()` to be more visually pleasant than `color.Colorize()`, I included `Ize()` as an alias for `Colorize()`.
4346

44-
### Why is it called Ize
45-
46-
Because I felt reading `color.Ize(...)` to be more visually pleasant than `color.Colorize(...)`
47+
I'm not usually a big fan of having two methods doing the same thing, but since
48+
this package doesn't have much room for growth (its only purpose is to colorize
49+
terminal outputs, after all, and there isn't hundreds of ways to go about it),
50+
I believe it's acceptable to have both.
4751

4852

4953
## Installation

0 commit comments

Comments
 (0)