aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2021-09-10 11:25:42 +0200
committerHimbeerserverDE <himbeerserverde@gmail.com>2021-09-10 11:25:42 +0200
commit04d33fd100b67da504b16d9f98baa255d5060028 (patch)
tree71542a9478804caa2559795e4ed1df274faa59eb
parent1c5a72c3ef286d323edbd32ee39e9a4f88f9570a (diff)
Add Colorize helper
-rw-r--r--chat.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/chat.go b/chat.go
index 5cae3db..e355b2a 100644
--- a/chat.go
+++ b/chat.go
@@ -16,6 +16,10 @@ func (cc *ClientConn) SendChatMsg(msg ...string) {
})
}
+func Colorize(text, color string) string {
+ return string(0x1b) + "(c@" + color + ")" + text + string(0x1b) + "(c@#FFF)"
+}
+
func onChatMsg(cc *ClientConn, cmd *mt.ToSrvChatMsg) (string, bool) {
initChatCmds()