update tcell to v2 and enable TrueColor support

Also update to the tcell v2 PaletteColor api, which should keep the chosen
theme of the user intact.

Note, that if $TRUECOLOR is defined and a truecolor given, aerc will now stop
clipping the value to one of the theme colors.
Generally this is desired behaviour though.
This commit is contained in:
y0ast 2020-11-30 22:07:03 +00:00 committed by Reto Brunner
parent af0a2b9a46
commit 03650474e2
31 changed files with 36 additions and 41 deletions

View file

@ -13,7 +13,7 @@ import (
"git.sr.ht/~sircmpwn/aerc/lib" "git.sr.ht/~sircmpwn/aerc/lib"
"git.sr.ht/~sircmpwn/aerc/models" "git.sr.ht/~sircmpwn/aerc/models"
"git.sr.ht/~sircmpwn/aerc/widgets" "git.sr.ht/~sircmpwn/aerc/widgets"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"github.com/mitchellh/go-homedir" "github.com/mitchellh/go-homedir"
) )

View file

@ -7,7 +7,7 @@ import (
"io" "io"
"strings" "strings"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
) )
type KeyStroke struct { type KeyStroke struct {

View file

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )

View file

@ -14,7 +14,7 @@ import (
"time" "time"
"unicode" "unicode"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"github.com/go-ini/ini" "github.com/go-ini/ini"
"github.com/imdario/mergo" "github.com/imdario/mergo"
"github.com/kyoh86/xdg" "github.com/kyoh86/xdg"

View file

@ -8,7 +8,7 @@ import (
"regexp" "regexp"
"strings" "strings"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"github.com/go-ini/ini" "github.com/go-ini/ini"
"github.com/mitchellh/go-homedir" "github.com/mitchellh/go-homedir"
) )

5
go.mod
View file

@ -16,14 +16,13 @@ require (
github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21 github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21
github.com/emersion/go-smtp v0.12.1 github.com/emersion/go-smtp v0.12.1
github.com/fsnotify/fsnotify v1.4.7 github.com/fsnotify/fsnotify v1.4.7
github.com/gdamore/tcell v1.3.0 github.com/gdamore/tcell/v2 v2.0.0
github.com/go-ini/ini v1.52.0 github.com/go-ini/ini v1.52.0
github.com/golang/protobuf v1.3.4 // indirect github.com/golang/protobuf v1.3.4 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c // indirect github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c // indirect
github.com/imdario/mergo v0.3.8 github.com/imdario/mergo v0.3.8
github.com/kyoh86/xdg v1.2.0 github.com/kyoh86/xdg v1.2.0
github.com/lucasb-eyer/go-colorful v1.0.3 // indirect
github.com/mattn/go-isatty v0.0.12 github.com/mattn/go-isatty v0.0.12
github.com/mattn/go-pointer v0.0.0-20190911064623-a0a44394634f // indirect github.com/mattn/go-pointer v0.0.0-20190911064623-a0a44394634f // indirect
github.com/mattn/go-runewidth v0.0.8 github.com/mattn/go-runewidth v0.0.8
@ -46,6 +45,4 @@ require (
replace golang.org/x/crypto => github.com/ProtonMail/crypto v0.0.0-20200420072808-71bec3603bf3 replace golang.org/x/crypto => github.com/ProtonMail/crypto v0.0.0-20200420072808-71bec3603bf3
replace github.com/gdamore/tcell => git.sr.ht/~sircmpwn/tcell v0.0.0-20190807054800-3fdb6bc01a50
replace github.com/zenhack/go.notmuch => github.com/brunnre8/go.notmuch v0.0.0-20201126061756-caa2daf7093c replace github.com/zenhack/go.notmuch => github.com/brunnre8/go.notmuch v0.0.0-20201126061756-caa2daf7093c

8
go.sum
View file

@ -1,9 +1,6 @@
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
git.sr.ht/~sircmpwn/getopt v0.0.0-20190808004552-daaf1274538b h1:da5JBQ6dcW14aWnEf/pFRIMV2PsqTQEWmR+V2sw5oxU= git.sr.ht/~sircmpwn/getopt v0.0.0-20190808004552-daaf1274538b h1:da5JBQ6dcW14aWnEf/pFRIMV2PsqTQEWmR+V2sw5oxU=
git.sr.ht/~sircmpwn/getopt v0.0.0-20190808004552-daaf1274538b/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw= git.sr.ht/~sircmpwn/getopt v0.0.0-20190808004552-daaf1274538b/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw=
git.sr.ht/~sircmpwn/tcell v0.0.0-20190807054800-3fdb6bc01a50 h1:GEZXdK3vfsEGlRwlybiAvOnYLA4YKaVWxAQSn/BSkNw=
git.sr.ht/~sircmpwn/tcell v0.0.0-20190807054800-3fdb6bc01a50/go.mod h1:Hjvr+Ofd+gLglo7RYKxxnzCBmev3BzsS67MebKS4zMM=
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/ProtonMail/crypto v0.0.0-20200420072808-71bec3603bf3 h1:JW27/kGLQzeM1Fxg5YQhdkTEAU7HIAHMgSag35zVTnY= github.com/ProtonMail/crypto v0.0.0-20200420072808-71bec3603bf3 h1:JW27/kGLQzeM1Fxg5YQhdkTEAU7HIAHMgSag35zVTnY=
github.com/ProtonMail/crypto v0.0.0-20200420072808-71bec3603bf3/go.mod h1:Pxr7w4gA2ikI4sWyYwEffm+oew1WAJHzG1SiDpQMkrI= github.com/ProtonMail/crypto v0.0.0-20200420072808-71bec3603bf3/go.mod h1:Pxr7w4gA2ikI4sWyYwEffm+oew1WAJHzG1SiDpQMkrI=
github.com/brunnre8/go.notmuch v0.0.0-20201126061756-caa2daf7093c h1:dh58QrW3/S/aCnQPFoeRRE9zMauKooDFd5zh1dLtxXs= github.com/brunnre8/go.notmuch v0.0.0-20201126061756-caa2daf7093c h1:dh58QrW3/S/aCnQPFoeRRE9zMauKooDFd5zh1dLtxXs=
@ -48,6 +45,8 @@ github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
github.com/gdamore/tcell/v2 v2.0.0 h1:GRWG8aLfWAlekj9Q6W29bVvkHENc6hp79XOqG4AWDOs=
github.com/gdamore/tcell/v2 v2.0.0/go.mod h1:vSVL/GV5mCSlPC6thFP5kfOFdM9MGZcalipmpTxTgQA=
github.com/go-ini/ini v1.52.0 h1:3UeUAveYUTCYV/G0jNDiIrrtIeAl1oAjshYyU2PaAlQ= github.com/go-ini/ini v1.52.0 h1:3UeUAveYUTCYV/G0jNDiIrrtIeAl1oAjshYyU2PaAlQ=
github.com/go-ini/ini v1.52.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-ini/ini v1.52.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@ -65,7 +64,6 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/kyoh86/xdg v1.2.0 h1:CERuT/ShdTDj+A2UaX3hQ3mOV369+Sj+wyn2nIRIIkI= github.com/kyoh86/xdg v1.2.0 h1:CERuT/ShdTDj+A2UaX3hQ3mOV369+Sj+wyn2nIRIIkI=
github.com/kyoh86/xdg v1.2.0/go.mod h1:/mg8zwu1+qe76oTFUBnyS7rJzk7LLC0VGEzJyJ19DHs= github.com/kyoh86/xdg v1.2.0/go.mod h1:/mg8zwu1+qe76oTFUBnyS7rJzk7LLC0VGEzJyJ19DHs=
github.com/lucasb-eyer/go-colorful v1.0.2/go.mod h1:0MS4r+7BZKSJ5mw4/S5MPN+qHFF1fYclkSPilDOKW0s=
github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac= github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac=
github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/martinlindhe/base36 v0.0.0-20190418230009-7c6542dfbb41/go.mod h1:+AtEs8xrBpCeYgSLoY/aJ6Wf37jtBuR0s35750M27+8= github.com/martinlindhe/base36 v0.0.0-20190418230009-7c6542dfbb41/go.mod h1:+AtEs8xrBpCeYgSLoY/aJ6Wf37jtBuR0s35750M27+8=
@ -78,7 +76,7 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky
github.com/mattn/go-pointer v0.0.0-20180825124634-49522c3f3791/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc= github.com/mattn/go-pointer v0.0.0-20180825124634-49522c3f3791/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc=
github.com/mattn/go-pointer v0.0.0-20190911064623-a0a44394634f h1:QTRRO+ozoYgT3CQRIzNVYJRU3DB8HRnkZv6mr4ISmMA= github.com/mattn/go-pointer v0.0.0-20190911064623-a0a44394634f h1:QTRRO+ozoYgT3CQRIzNVYJRU3DB8HRnkZv6mr4ISmMA=
github.com/mattn/go-pointer v0.0.0-20190911064623-a0a44394634f/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc= github.com/mattn/go-pointer v0.0.0-20190911064623-a0a44394634f/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.8 h1:3tS41NlGYSmhhe/8fhGRzc+z3AYCw1Fe1WAyLuujKs0= github.com/mattn/go-runewidth v0.0.8 h1:3tS41NlGYSmhhe/8fhGRzc+z3AYCw1Fe1WAyLuujKs0=
github.com/mattn/go-runewidth v0.0.8/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.8/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/miolini/datacounter v1.0.2 h1:mGTL0vqEAtH7mwNJS1JIpd6jwTAP6cBQQ2P8apaCIm8= github.com/miolini/datacounter v1.0.2 h1:mGTL0vqEAtH7mwNJS1JIpd6jwTAP6cBQQ2P8apaCIm8=

View file

@ -1,7 +1,7 @@
package ui package ui
import ( import (
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/config"
) )

View file

@ -3,8 +3,8 @@ package ui
import ( import (
"fmt" "fmt"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"github.com/gdamore/tcell/views" "github.com/gdamore/tcell/v2/views"
"github.com/mattn/go-runewidth" "github.com/mattn/go-runewidth"
) )

View file

@ -1,7 +1,7 @@
package ui package ui
import ( import (
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
) )
type Fill rune type Fill rune

View file

@ -6,7 +6,7 @@ import (
"sync" "sync"
"sync/atomic" "sync/atomic"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
) )
type Grid struct { type Grid struct {

View file

@ -1,7 +1,7 @@
package ui package ui
import ( import (
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
) )
// Drawable is a UI component that can draw. Unless specified, all methods must // Drawable is a UI component that can draw. Unless specified, all methods must

View file

@ -1,6 +1,6 @@
package ui package ui
import "github.com/gdamore/tcell" import "github.com/gdamore/tcell/v2"
type Popover struct { type Popover struct {
x, y, width, height int x, y, width, height int

View file

@ -5,7 +5,7 @@ import (
"git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/config"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
) )
type Stack struct { type Stack struct {

View file

@ -3,7 +3,7 @@ package ui
import ( import (
"io" "io"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"github.com/mattn/go-runewidth" "github.com/mattn/go-runewidth"
"git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/config"

View file

@ -1,7 +1,7 @@
package ui package ui
import ( import (
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"github.com/mattn/go-runewidth" "github.com/mattn/go-runewidth"
) )

View file

@ -4,7 +4,7 @@ import (
"math" "math"
"time" "time"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"github.com/mattn/go-runewidth" "github.com/mattn/go-runewidth"
"git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/config"

View file

@ -3,7 +3,7 @@ package ui
import ( import (
"sync/atomic" "sync/atomic"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
) )
type UI struct { type UI struct {

View file

@ -11,7 +11,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"github.com/go-ini/ini" "github.com/go-ini/ini"
"github.com/kyoh86/xdg" "github.com/kyoh86/xdg"

View file

@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"log" "log"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/config"
"git.sr.ht/~sircmpwn/aerc/lib" "git.sr.ht/~sircmpwn/aerc/lib"

View file

@ -10,7 +10,7 @@ import (
"time" "time"
"github.com/emersion/go-message/mail" "github.com/emersion/go-message/mail"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"github.com/google/shlex" "github.com/google/shlex"
"golang.org/x/crypto/openpgp" "golang.org/x/crypto/openpgp"

View file

@ -16,7 +16,7 @@ import (
"time" "time"
"github.com/emersion/go-message/mail" "github.com/emersion/go-message/mail"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"github.com/mattn/go-runewidth" "github.com/mattn/go-runewidth"
"github.com/mitchellh/go-homedir" "github.com/mitchellh/go-homedir"
"github.com/pkg/errors" "github.com/pkg/errors"

View file

@ -7,7 +7,7 @@ import (
"regexp" "regexp"
"sort" "sort"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"github.com/mattn/go-runewidth" "github.com/mattn/go-runewidth"
"git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/config"

View file

@ -1,7 +1,7 @@
package widgets package widgets
import ( import (
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/config"
"git.sr.ht/~sircmpwn/aerc/lib" "git.sr.ht/~sircmpwn/aerc/lib"

View file

@ -3,7 +3,7 @@ package widgets
import ( import (
"fmt" "fmt"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/config"
"git.sr.ht/~sircmpwn/aerc/lib/ui" "git.sr.ht/~sircmpwn/aerc/lib/ui"

View file

@ -5,7 +5,7 @@ import (
"log" "log"
"math" "math"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"github.com/mattn/go-runewidth" "github.com/mattn/go-runewidth"
"git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/config"

View file

@ -11,7 +11,7 @@ import (
"strings" "strings"
"github.com/danwakefield/fnmatch" "github.com/danwakefield/fnmatch"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"github.com/google/shlex" "github.com/google/shlex"
"github.com/mattn/go-runewidth" "github.com/mattn/go-runewidth"

View file

@ -1,7 +1,7 @@
package widgets package widgets
import ( import (
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/config"
"git.sr.ht/~sircmpwn/aerc/lib/ui" "git.sr.ht/~sircmpwn/aerc/lib/ui"

View file

@ -5,7 +5,7 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/config"
"git.sr.ht/~sircmpwn/aerc/lib/ui" "git.sr.ht/~sircmpwn/aerc/lib/ui"

View file

@ -3,7 +3,7 @@ package widgets
import ( import (
"time" "time"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
"github.com/mattn/go-runewidth" "github.com/mattn/go-runewidth"
"git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/config"

View file

@ -10,7 +10,7 @@ import (
"github.com/creack/pty" "github.com/creack/pty"
"github.com/ddevault/go-libvterm" "github.com/ddevault/go-libvterm"
"github.com/gdamore/tcell" "github.com/gdamore/tcell/v2"
) )
type vtermKey struct { type vtermKey struct {
@ -406,7 +406,7 @@ func (term *Terminal) styleFromCell(cell *vterm.ScreenCell) tcell.Style {
if background.IsDefaultBg() { if background.IsDefaultBg() {
bg = tcell.ColorDefault bg = tcell.ColorDefault
} else if background.IsIndexed() { } else if background.IsIndexed() {
bg = tcell.Color(background.GetIndex()) bg = tcell.Color(tcell.PaletteColor(int(background.GetIndex())))
} else if background.IsRgb() { } else if background.IsRgb() {
r, g, b := background.GetRGB() r, g, b := background.GetRGB()
bg = tcell.NewRGBColor(int32(r), int32(g), int32(b)) bg = tcell.NewRGBColor(int32(r), int32(g), int32(b))
@ -414,7 +414,7 @@ func (term *Terminal) styleFromCell(cell *vterm.ScreenCell) tcell.Style {
if foreground.IsDefaultFg() { if foreground.IsDefaultFg() {
fg = tcell.ColorDefault fg = tcell.ColorDefault
} else if foreground.IsIndexed() { } else if foreground.IsIndexed() {
fg = tcell.Color(foreground.GetIndex()) fg = tcell.Color(tcell.PaletteColor(int(foreground.GetIndex())))
} else if foreground.IsRgb() { } else if foreground.IsRgb() {
r, g, b := foreground.GetRGB() r, g, b := foreground.GetRGB()
fg = tcell.NewRGBColor(int32(r), int32(g), int32(b)) fg = tcell.NewRGBColor(int32(r), int32(g), int32(b))