fatih / color

Color package for Go (golang)
https://pkg.go.dev/github.com/fatih/color
MIT License
7.24k stars 615 forks source link

Fluent-Style API for DisableColor/EnableColor #130

Closed sp3c73r2038 closed 3 years ago

sp3c73r2038 commented 3 years ago

This will enable usage like

var red = color.New(color.FgRed).Add(color.Bold).EnableColor().Sprint

fmt.Println(red("I'm red."))
fatih commented 3 years ago

Hi @aleiphoenix

You can already use this style with something like:

red := color.New(color.FgRed).Add(color.Bold).SprintFunc()
fmt.Println(red("I'm red."))

Do I miss something with your PR maybe? Also this is a breaking change. None of the functions signature should change.

Closing this for now, but feel free to re-open an issue if you want to discuss it further. Thank you for your contribution.