From 2d55d25eaa27227c306c97928f8ca5205a7e63e3 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Thu, 31 Oct 2013 21:07:34 +0100 Subject: Preparing editable biomes. Most stuff doesnt update correctly now... --- colbuf.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 colbuf.go (limited to 'colbuf.go') 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 +} -- cgit v1.2.3-54-g00ecf