summaryrefslogtreecommitdiff
path: root/colbuf.go
blob: 429bf6c1745951e3ac33e63785e574a3fd4705a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
}