func RGBColorMulNumber(c *ast.RGBColor, n *ast.Number) *ast.RGBColor { var val = uint32(n.Value) var r = c.R * val var g = c.G * val var b = c.B * val return ast.NewRGBColor(r, g, b, nil) }
func RGBColorDivNumber(c *ast.RGBColor, n *ast.Number) *ast.RGBColor { 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.NewRGBColor(uint32(r), uint32(g), uint32(b), nil) }
func RGBColorSubNumber(c *ast.RGBColor, n *ast.Number) *ast.RGBColor { 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.NewRGBColor(r, g, b, nil) }