diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2026-02-09 22:00:33 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2026-02-09 22:00:33 -0500 |
| commit | 8f28d1044fb83153fde4505421b75072930d6fb9 (patch) | |
| tree | ec39000ed901dc959626fc09d8e270268c6b3d03 /color.go | |
| parent | 5fde17eafa11bf397bbf1f18864b8ee26d9a701d (diff) | |
| download | gui-8f28d1044fb83153fde4505421b75072930d6fb9.zip | |
layout: add background color option
Diffstat (limited to 'color.go')
| -rw-r--r-- | color.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/color.go b/color.go new file mode 100644 index 0000000..e2b9bc1 --- /dev/null +++ b/color.go @@ -0,0 +1,12 @@ +package gui + +import ( + "fmt" + "image/color" +) + +func HexToColor(hex string) color.Color { + var r, g, b uint8 + fmt.Sscanf(hex, "#%2X%2X%2X", &r, &g, &b) + return color.RGBA{r, g, b, 255} +} |