package image
var (
Aqua = ColorImage{RGBAColor{0x00, 0xff, 0xff, 0xff}}
Black = ColorImage{RGBAColor{0x00, 0x00, 0x00, 0xff}}
Blue = ColorImage{RGBAColor{0x00, 0x00, 0xff, 0xff}}
Fuchsia = ColorImage{RGBAColor{0xff, 0x00, 0xff, 0xff}}
Gray = ColorImage{RGBAColor{0x80, 0x80, 0x80, 0xff}}
Green = ColorImage{RGBAColor{0x00, 0x80, 0x00, 0xff}}
Lime = ColorImage{RGBAColor{0x00, 0xff, 0x00, 0xff}}
Maroon = ColorImage{RGBAColor{0x80, 0x00, 0x00, 0xff}}
Navy = ColorImage{RGBAColor{0x00, 0x00, 0x80, 0xff}}
Olive = ColorImage{RGBAColor{0x80, 0x80, 0x00, 0xff}}
Red = ColorImage{RGBAColor{0xff, 0x00, 0x00, 0xff}}
Purple = ColorImage{RGBAColor{0x80, 0x00, 0x80, 0xff}}
Silver = ColorImage{RGBAColor{0xc0, 0xc0, 0xc0, 0xff}}
Teal = ColorImage{RGBAColor{0x00, 0x80, 0x80, 0xff}}
White = ColorImage{RGBAColor{0xff, 0xff, 0xff, 0xff}}
Yellow = ColorImage{RGBAColor{0xff, 0xff, 0x00, 0xff}}
Cyan = Aqua
Magenta = Fuchsia
)
type ColorImage struct {
C Color
}
func (c ColorImage) RGBA() (r, g, b, a uint32) {
return c.C.RGBA()
}
func (c ColorImage) ColorModel() ColorModel {
return ColorModelFunc(func(Color) Color { return c.C })
}
func (c ColorImage) Width() int { return 1e9 }
func (c ColorImage) Height() int { return 1e9 }
func (c ColorImage) At(x, y int) Color { return c.C }
func (c ColorImage) Opaque() bool {
_, _, _, a := c.C.RGBA()
return a == 0xffff
}