From cd405ccb6af8ae1962b24d7456f159c57ef9b8a6 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Tue, 5 Nov 2024 06:20:59 +0100 Subject: WIP: xA: IRC colors #2 --- xA/xA.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'xA/xA.go') diff --git a/xA/xA.go b/xA/xA.go index 7c2231f..4d4a5f0 100644 --- a/xA/xA.go +++ b/xA/xA.go @@ -69,10 +69,13 @@ func convertColor(c int) color.Color { var ircColors = make(map[fyne.ThemeColorName]color.Color) +func ircColorName(color int) fyne.ThemeColorName { + return fyne.ThemeColorName(fmt.Sprintf("irc%02x", color)) +} + func init() { for color := 0; color < 256; color++ { - ircColors[fyne.ThemeColorName( - fmt.Sprintf("irc%02x", color))] = convertColor(color) + ircColors[ircColorName(color)] = convertColor(color) } } @@ -115,7 +118,7 @@ type bufferLineItem struct { format fyne.TextStyle // For RichTextStyle.ColorName. // XXX: Fyne's RichText doesn't support background colours. - color string + color fyne.ThemeColorName text string } -- cgit v1.2.3-70-g09d2