diff options
author | Kevin Chabowski <kevin@kch42.de> | 2013-11-04 20:59:28 +0100 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2013-11-04 20:59:28 +0100 |
commit | 3acbc6d81592560dc95b1ce9ee548627042acfc5 (patch) | |
tree | 1fc9801fd8850e5fef6c2c395b685fe7aa218bf4 /colbuf.go | |
parent | e2730e8e796bf05cfb0681068e40d0c8fb6228b2 (diff) | |
parent | 9b006397c30d49e4843b4e5479670a645f435dd9 (diff) | |
download | biomed-3acbc6d81592560dc95b1ce9ee548627042acfc5.tar.gz biomed-3acbc6d81592560dc95b1ce9ee548627042acfc5.tar.bz2 biomed-3acbc6d81592560dc95b1ce9ee548627042acfc5.zip |
Merge branch 'editable-biomes'
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 +} |