Using tcell.Colors instead of HardCoding Hex Values

This commit is contained in:
aditya-K2
2021-12-30 17:17:58 +05:30
parent a3c5af06c8
commit 4a0a3e18f7
5 changed files with 12 additions and 11 deletions

View File

@@ -36,10 +36,10 @@ func NewApplication() *Application {
imagePreviewer.SetBackgroundColor(tcell.ColorDefault)
searchBar.SetTitle("Search").SetTitleAlign(tview.AlignLeft)
searchBar.SetAutocompleteBackgroundColor(tcell.GetColor("#15191a"))
searchBar.SetAutocompleteSelectBackgroundColor(tcell.GetColor("#e5e5e5"))
searchBar.SetAutocompleteMainTextColor(tcell.GetColor("#7f7f7f"))
searchBar.SetAutocompleteSelectedTextColor(tcell.GetColor("#111111"))
searchBar.SetAutocompleteBackgroundColor(tcell.ColorBlack)
searchBar.SetAutocompleteSelectBackgroundColor(tcell.ColorWhite)
searchBar.SetAutocompleteMainTextColor(tcell.ColorDarkGray)
searchBar.SetAutocompleteSelectedTextColor(tcell.ColorBlack)
Navbar.SetBorder(true)
Navbar.SetSelectable(true, false)
Navbar.SetCell(0, 0, tview.NewTableCell("PlayList"))

View File

@@ -1,9 +1,10 @@
package notify
import (
"github.com/aditya-K2/gomp/ui"
"time"
"github.com/aditya-K2/gomp/ui"
"github.com/aditya-K2/gomp/utils"
"github.com/aditya-K2/tview"
@@ -43,12 +44,12 @@ func (self *Notification) Draw(screen tcell.Screen) {
TEXTPOSITION int = 2
)
self.Box.SetBackgroundColor(tcell.GetColor("#15191a"))
self.Box.SetBackgroundColor(tcell.ColorBlack)
self.SetRect(COL-(TEXTLENGTH+7), 1, TEXTLENGTH+4, HEIGHT)
self.DrawForSubclass(screen, self.Box)
tview.Print(screen, self.Text,
COL-(TEXTLENGTH+5), TEXTPOSITION, TEXTLENGTH,
tview.AlignCenter, tcell.GetColor("#ffffff"))
tview.AlignCenter, tcell.ColorWhite)
}
/* Notification Server : Not an actual Server*/