summaryrefslogtreecommitdiff
path: root/color.go
diff options
context:
space:
mode:
Diffstat (limited to 'color.go')
-rw-r--r--color.go101
1 files changed, 89 insertions, 12 deletions
diff --git a/color.go b/color.go
index 6861d45..5e5029f 100644
--- a/color.go
+++ b/color.go
@@ -9,6 +9,8 @@ package main
import (
"math/rand"
+ "github.com/gdamore/tcell/v2"
+
"github.com/awesome-gocui/gocui"
"go.wit.com/log"
@@ -18,15 +20,6 @@ import (
//color.go: w.v.SelFgColor = gocui.ColorBlack
//color.go: w.v.BgColor = gocui.ColorGreen
-type colorT struct {
- frame gocui.Attribute
- fg gocui.Attribute
- bg gocui.Attribute
- selFg gocui.Attribute
- selBg gocui.Attribute
- name string
-}
-
var none gocui.Attribute = gocui.AttrNone
var lightPurple gocui.Attribute = gocui.GetColor("#DDDDDD") // light purple
var darkPurple gocui.Attribute = gocui.GetColor("#FFAA55") // Dark Purple
@@ -51,11 +44,22 @@ var colorWindow colorT = colorT{
frame: none,
fg: gocui.ColorBlue,
bg: none,
- selFg: none,
- selBg: powdererBlue,
+ selFg: gocui.ColorWhite,
+ // selBg: powdererBlue,
+ selBg: gocui.ColorBlue,
name: "normal window",
}
-var colorActiveW colorT = colorT{none, none, powdererBlue, none, powdererBlue, "active window"} // sets the window to blue
+
+var colorActiveW colorT = colorT{
+ frame: none,
+ fg: gocui.ColorWhite,
+ bg: gocui.ColorBlue,
+ selFg: gocui.ColorBlue,
+ selBg: none,
+ name: "normal window",
+}
+
+// var colorActiveW colorT = colorT{none, none, powdererBlue, none, powdererBlue, "active window"} // sets the window to blue
var colorTab colorT = colorT{gocui.ColorBlue, gocui.ColorBlue, none, none, powdererBlue, "normal tab"}
var colorActiveT colorT = colorT{gocui.ColorBlue, none, powdererBlue, none, powdererBlue, "active tab"}
@@ -103,6 +107,7 @@ var colorButtonDense colorT = colorT{
frame: none,
fg: none,
bg: gocui.ColorGreen,
+ // bg: tcell.ColorGreen,
selFg: none,
selBg: gocui.ColorWhite,
name: "normal button",
@@ -228,3 +233,75 @@ func get_teminal_color_palette() string {
return color1 + " " + color2 + " " + color3 + " " + color4 + " " + color5 + " " + color6 + " " + color7 + " " + color8
}
+
+func (tk *guiWidget) SetColorRed() {
+ tk.color = new(colorT)
+ tk.color.fg = gocui.ColorRed
+}
+
+func (tk *guiWidget) setColorBlue() {
+ // r, g, b :=
+ // newgreen := gocui.NewRGBColor(tcell.ColorLightBlue.RGB())
+
+ // tk.color.fg = gocui.ColorBlue
+ tk.color.bg = gocui.NewRGBColor(tcell.ColorLightBlue.RGB())
+}
+
+// weird. lots of color problems for me on debian sid using the traditional Andy Herzfield 'gnome'
+func (tk *guiWidget) setColorButtonDenseOLD() {
+ /*
+ cellgreen := tcell.ColorLightGreen
+ r, g, b := cellgreen.RGB()
+ newgreen := gocui.NewRGBColor(r, g, b)
+ */
+
+ // tk.color.fg = gocui.ColorBlue
+ if tk.color == nil {
+ tk.color = new(colorT)
+ }
+ lightGreen := gocui.GetColor("0x90EE90")
+ lightGreen = gocui.GetColor("0x008000")
+ lightGreen = gocui.NewRGBColor(0x00, 0x80, 0x00)
+
+ tk.color.frame = gocui.ColorYellow
+ tk.color.fg = gocui.AttrNone
+ tk.color.bg = gocui.ColorGreen
+ tk.color.bg = lightGreen
+ tk.color.bg = gocui.Attribute(tcell.ColorLightGreen)
+ tk.color.bg = superLightGrey
+ // bg: gocui.ColorGreen,
+ tk.color.selFg = gocui.AttrNone
+ tk.color.selBg = gocui.ColorGreen
+
+ // tk.color = &colorButtonDense
+
+ /*
+ tk.color.selFg = gocui.AttrNone
+ r, g, b := tcell.ColorLightGreen.RGB()
+ log.Info("color =", tcell.ColorLightGreen.CSS(), r, g, b)
+ tk.color.selBg = gocui.NewRGBColor(r, g, b)
+ */
+}
+
+// weird. lots of color problems for me on debian sid using the traditional Andy Herzfield 'gnome'
+func (tk *guiWidget) setColorWindow() {
+ if tk.color == nil {
+ tk.color = new(colorT)
+ }
+ tk.color.frame = gocui.AttrNone
+ tk.color.fg = gocui.ColorBlue
+ tk.color.bg = gocui.AttrNone
+ tk.color.selFg = gocui.ColorWhite
+ tk.color.selBg = gocui.ColorBlue
+}
+
+func (tk *guiWidget) setColorButtonDense() {
+ if tk.color == nil {
+ tk.color = new(colorT)
+ }
+ tk.color.frame = gocui.AttrNone
+ tk.color.fg = gocui.ColorBlue
+ tk.color.bg = gocui.AttrNone
+ tk.color.selFg = gocui.ColorWhite
+ tk.color.selBg = gocui.ColorBlue
+}