//NewLinearGradient creates a new linear gradient, from start to end, //with specified color stops. // //Originally cairo_pattern_create_linear and cairo_pattern_add_color_stop_rgba. func NewLinearGradient(start, end Point, colorStops ...ColorStop) LinearGradient { x0, y0 := start.c() x1, y1 := end.c() p := C.cairo_pattern_create_linear(x0, y0, x1, y1) P := patternGradient{ XtensionPattern: XtensionNewPattern(p), } P.addColorStops(colorStops) return LinearGradient{ patternGradient: P, start: start, end: end, } }
// cairo_pattern_t* cairo_pattern_create_linear (double x0, double y0, double x1, double y1); func LinearGradient(x0, y0, x1, y1 float64) (pattern *Pattern) { return &Pattern{C.cairo_pattern_create_linear(C.double(x0), C.double(y0), C.double(x1), C.double(y1))} }