aboutsummaryrefslogtreecommitdiff
path: root/xA
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2024-11-05 06:20:59 +0100
committerPřemysl Eric Janouch <p@janouch.name>2024-11-09 17:20:18 +0100
commitc0433b462a3e64926f16e7192a5fbc06cc641c90 (patch)
treee6cb9110d7bf687700c50725be860a2ffd5a2b2e /xA
parent2f32bda5697a6ed8163019f5d6a1f6be76007bb8 (diff)
downloadxK-c0433b462a3e64926f16e7192a5fbc06cc641c90.tar.gz
xK-c0433b462a3e64926f16e7192a5fbc06cc641c90.tar.xz
xK-c0433b462a3e64926f16e7192a5fbc06cc641c90.zip
WIP: xA: IRC colors #2
Diffstat (limited to 'xA')
-rw-r--r--xA/xA.go9
1 files changed, 6 insertions, 3 deletions
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
}