place/api/structs/structs.go

22 lines
332 B
Go
Raw Permalink Normal View History

2024-06-13 11:25:18 +00:00
package structs
type Coordinates struct {
X int `form:"x" json:"x"`
Y int `form:"y" json:"y"`
}
type Color struct {
R uint32 `form:"r" json:"r"`
G uint32 `form:"g" json:"g"`
B uint32 `form:"b" json:"b"`
}
2024-06-13 17:25:45 +00:00
type Pixel struct {
Coordinates
Color
}
2024-06-13 11:25:18 +00:00
func (c *Color) RGBA() (r, g, b, a uint32) {
return c.R, c.G, c.B, 65535
}