Implemented GetColorFnFromHex

This commit is contained in:
マリウス 2020-10-17 01:32:18 +01:00
parent e849959b6b
commit b6eefeb0c8
No known key found for this signature in database
GPG key ID: C228EF0A530AF06F

View file

@ -108,3 +108,10 @@ func OutputAppendRight(leftStr string, rightStr string, pad int) (string) {
return output return output
} }
func GetColorFnFromHex(colorHex string) (func(...interface {}) string) {
if colorHex == "" {
colorHex = "#dddddd"
}
return color.NewRGBStyle(color.HEX(colorHex)).Sprint
}