Pinball dot-matrix clock animation thingy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

34 lines
612 B

package driver
import "image/color"
var ColorModel = color.ModelFunc(colorModel)
type Color uint32
func (c Color) RGBA() (r, g, b, a uint32) {
r = uint32(c>>16) & 0xff
r |= r << 8
g = uint32(c>>8) & 0xff
g |= g << 8
b = uint32(c) & 0xff
b |= b << 8
a = 0xffff
return
}
func ToColor(c color.Color) Color {
if c, ok := c.(Color); ok {
return c
}
r, g, b, _ := c.RGBA()
return Color((r&0xff)<<16 | (g&0xff)<<8 | (b & 0xff))
}
func colorModel(c color.Color) color.Color {
if c, ok := c.(Color); ok {
return c
}
r, g, b, _ := c.RGBA()
return Color((r&0xff)<<16 | (g&0xff)<<8 | (b & 0xff))
}