Example #1
0
File: color.go Project: se77en/c6
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)
}
Example #2
0
File: color.go Project: se77en/c6
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)
}
Example #3
0
File: color.go Project: se77en/c6
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)
}