added library and initial commit for gui

This commit is contained in:
0xdcarns
2022-05-04 16:47:35 -04:00
parent 390156a48a
commit cd065e35f4
14 changed files with 561 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
package components
import (
"image/color"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/layout"
"fyne.io/fyne/v2/widget"
)
// ColoredText - renders a colored label
func ColoredText(text string, color color.Color) *fyne.Container {
btn := widget.NewLabel(text)
bgColor := canvas.NewRectangle(color)
return container.New(
layout.NewMaxLayout(),
bgColor,
btn,
)
}