diff --git a/chat/message.go b/chat/message.go index 2fc857d..b4bfee5 100644 --- a/chat/message.go +++ b/chat/message.go @@ -196,11 +196,14 @@ func NewSystemMsg(body string, to *User) *SystemMsg { } func (m *SystemMsg) Render(t *Theme) string { - return fmt.Sprintf("-> %s", m.body) + if t == nil { + return m.String() + } + return t.ColorSys(m.String()) } func (m *SystemMsg) String() string { - return m.Render(nil) + return fmt.Sprintf("-> %s", m.body) } func (m *SystemMsg) To() *User { @@ -223,11 +226,14 @@ func NewAnnounceMsg(body string) *AnnounceMsg { } func (m *AnnounceMsg) Render(t *Theme) string { - return fmt.Sprintf(" * %s", m.body) + if t == nil { + return m.String() + } + return t.ColorSys(m.String()) } func (m *AnnounceMsg) String() string { - return m.Render(nil) + return fmt.Sprintf(" * %s", m.body) } type CommandMsg struct { diff --git a/chat/theme.go b/chat/theme.go index 4d052f4..27085c0 100644 --- a/chat/theme.go +++ b/chat/theme.go @@ -186,5 +186,10 @@ func init() { }, } + // Debug for printing colors: + //for _, color := range palette.colors { + // fmt.Print(color.Format(color.String() + " ")) + //} + DefaultTheme = &Themes[0] }