func Draw(canvas *draw.RGB, opts Options) (out *draw.RGB) {
	w, h := 0, 0
	if canvas != nil {
		w, h = canvas.Size()
	}
	if w < opts.Width || h < opts.Height {
		canvas = draw.NewRGB(opts.Width, opts.Height)
	}
	scale := float64(len(opts.Colors)-1) / float64(opts.Height-1)
	for y := 0; y < opts.Height; y++ {
		index := int(float64(opts.Height-1-y) * scale)
		color := opts.Colors[index]
		for x := 0; x < opts.Width; x++ {
			canvas.Set(x, y, color)
		}
	}
	return canvas
}
Draw draws a key using values from Options on to the provided canvas,
allocating an output canvas if the input is not large enough.
package key
import (
	"github.com/vivint/rothko/draw"
)
type Options struct {
	Colors []draw.Color
	Height int
	Width int
}