diff options
Diffstat (limited to 'colbuf.go')
-rw-r--r-- | colbuf.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/colbuf.go b/colbuf.go new file mode 100644 index 0000000..429bf6c --- /dev/null +++ b/colbuf.go @@ -0,0 +1,17 @@ +package main + +import ( + "github.com/mattn/go-gtk/gdk" +) + +type ColorBuffer map[string]*gdk.Color + +func (cb ColorBuffer) Color(name string) *gdk.Color { + if col, ok := cb[name]; ok { + return col + } + + col := gdk.NewColor(name) + cb[name] = col + return col +} |