fill_rect_radial_gradient
Mojo function 🡭
fill_rect_radial_gradient
fn def fill_rect_radial_gradient(mut canvas: Canvas, x: Int, y: Int, width: Int, height: Int, gradient: RadialGradient)Like fill_rect_gradient, but for a RadialGradient. A rectangle isn’t the usual shape for a radial gradient, but a rectangular legend swatch or background panel wanting a radial highlight needs no circle primitive involved. Same once-up-front clamp as fill_rect.
Args:
- canvas (
Canvas): Canvas to fill into. - x (
Int): Rectangle’s left edge. - y (
Int): Rectangle’s top edge. - width (
Int): Rectangle’s width. - height (
Int): Rectangle’s height. - gradient (
RadialGradient): Fill source, projected across the rectangle.