Beispiel #1
0
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)
}
Beispiel #2
0
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)
}
Beispiel #3
0
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)
}