func RGBAColorSubNumber(c *ast.RGBAColor, n *ast.Number) *ast.RGBAColor { var val = uint32(n.Value) var r = uintsub(c.R, val) var g = uintsub(c.G, val) var b = uintsub(c.B, val) return ast.NewRGBAColor(r, g, b, c.A, nil) }
func RGBAColorMulNumber(c *ast.RGBAColor, n *ast.Number) *ast.RGBAColor { var val = uint32(n.Value) var r = c.R * val var g = c.G * val var b = c.B * val return ast.NewRGBAColor(r, g, b, c.A, nil) }
func RGBAColorDivNumber(c *ast.RGBAColor, n *ast.Number) *ast.RGBAColor { var val = n.Value var r = math.Floor(float64(c.R) / val) var g = math.Floor(float64(c.G) / val) var b = math.Floor(float64(c.B) / val) return ast.NewRGBAColor(uint32(r), uint32(g), uint32(b), c.A, nil) }