Ejemplo n.º 1
0
//NewSolidPattern creates a solid pattern of color c.
//
//Originally cairo_pattern_create_rgba.
func NewSolidPattern(c color.Color) SolidPattern {
	col := colorToAlpha(c)
	r, g, b, a := col.c()
	p := C.cairo_pattern_create_rgba(r, g, b, a)
	return SolidPattern{
		XtensionPattern: XtensionNewPattern(p),
		col:             col,
	}
}
Ejemplo n.º 2
0
// cairo_pattern_t* cairo_pattern_create_rgba (double red, double green, double blue, double alpha);
func SolidPatternRGBA(red, green, blue, alpha float64) (pattern *Pattern) {
	return &Pattern{C.cairo_pattern_create_rgba(C.double(red), C.double(green), C.double(blue), C.double(alpha))}
}