Draw an elliptical exterior with this color.

@param rect rectangle in which ellipse should fit
@param color colour to use for stroking
@param linewidth line width
333894
public void strokeEllipse(Rectangle rect, Color color, float linewidth) {
		template.saveState();
		setStroke(color, linewidth, null);
		template.ellipse(origX + rect.getLeft(), origY + rect.getBottom(), origX + rect.getRight(),
				origY + rect.getTop());
		template.stroke();
		template.restoreState();
	}
735290
public void setBarGraphColor(final ColorDef BARGRAPH_COLOR) {
        getModel().setValueColor(BARGRAPH_COLOR);
        init(getInnerBounds().width, getInnerBounds().width);
        repaint(getInnerBounds());
    }
837525
def _draw_rectangle(context, width, height):
        
        c = context
        # First move to upper left corner
        c.rel_move_to(-width / 2., -height / 2.)
        # Draw closed rectangle
        c.rel_line_to(width, 0)
        c.rel_line_to(0, height)
        c.rel_line_to(-width, 0)
        c.close_path()
734474
function filled_rectangle($x1, $y1, $w, $h, $color) {
    $this->_set_fill_color($color);

    $y1 = $this->y($y1) - $h;

    $this->_pdf->rect(floatval($x1), floatval($y1), floatval($w), floatval($h));
    $this->_pdf->fill();
  }
564390
public void drawRect(int x, int y, int w, int h, Color c) {
        int color = c.getRGB();
        for (int i = x; i < x + w; i++) {
            setIntColor(i, y, color);
            setIntColor(i, y + (h - 1), color);
        }

        for (int i = y; i < y + h; i++) {
            setIntColor(x, i, color);
            setIntColor(x + (w - 1), i, color);
        }
    }
1181535
private void drawCircle(Canvas canvas, float x, float y, int color, float circleScale) {
        dayPaint.setColor(color);
        if (animationStatus == ANIMATE_INDICATORS) {
            float maxRadius = circleScale * bigCircleIndicatorRadius * 1.4f;
            drawCircle(canvas, growfactorIndicator > maxRadius ? maxRadius: growfactorIndicator, x, y - (textHeight / 6));
        } else {
            drawCircle(canvas, circleScale * bigCircleIndicatorRadius, x, y - (textHeight / 6));
        }
    }
695700
public static void drawInRound(Bitmap src, Bitmap dest, int clearColor) {
        if (dest.getWidth() != dest.getHeight()) {
            throw new RuntimeException("dest Bitmap must have square size");
        }
        clearBitmap(dest, clearColor);
        Canvas canvas = new Canvas(dest);

        int r = dest.getWidth() / 2;
        Rect sourceRect = WorkCache.RECT1.get();
        Rect destRect = WorkCache.RECT2.get();
        sourceRect.set(0, 0, src.getWidth(), src.getHeight());
        destRect.set(0, 0, dest.getWidth(), dest.getHeight());

        Paint paint = WorkCache.PAINT.get();
        paint.reset();
        paint.setStyle(Paint.Style.FILL);
        paint.setColor(Color.RED);
        paint.setAntiAlias(true);
        canvas.drawCircle(r, r, r, paint);

        paint.reset();
        paint.setFilterBitmap(true);
        paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
        canvas.drawBitmap(src, sourceRect, destRect, paint);

        canvas.setBitmap(null);
    }
1203883
function drawRadialMajorTicks(context, options) {
    drawings.prepareTicks(options);

    //noinspection JSUnresolvedFunction
    let r = abs(radialTicksRadius(context, options));
    let i, colors;
    let s = options.majorTicks.length;
    let pixelRatio = SmartCanvas.pixelRatio;

    context.lineWidth = 2 * pixelRatio;
    context.save();

    colors = options.colorMajorTicks instanceof Array ?
        options.colorMajorTicks : new Array(s).fill(options.colorStrokeTicks ||
            options.colorMajorTicks);

    i = 0;
    for (; i < s; ++i) {
        context.strokeStyle = colors[i];
        context.rotate(drawings.radians(radialNextAngle(
            options,
            options.exactTicks ? options.majorTicks[i] : i,
            s
        )));

        context.beginPath();
        context.moveTo(0, r);
        context.lineTo(0, r - context.max * 0.15);
        closeStrokedPath(context);
    }

    if (options.strokeTicks) {
        context.strokeStyle = options.colorStrokeTicks || colors[0];
        context.rotate(HPI);

        context.beginPath();
        context.arc(0, 0, r,
            drawings.radians(options.startAngle),
            drawings.radians(options.startAngle + options.ticksAngle),
            false
        );
        closeStrokedPath(context);
    }
}
1308361
private void drawShape(
            Canvas canvas,
            Paint paint,
            Path path,
            ShapeAppearanceModel shapeAppearanceModel,
            RectF bounds) {
        if (shapeAppearanceModel.isRoundRect()) {
            float cornerSize = shapeAppearanceModel.getTopRightCorner().getCornerSize();
            canvas.drawRoundRect(bounds, cornerSize, cornerSize, paint);
        } else {
            canvas.drawPath(path, paint);
        }
    }
1325380
public void fillRectangle(Rectangle rect, Color color) {
		template.saveState();
		setFill(color);
		template.rectangle(origX + rect.getLeft(), origY + rect.getBottom(), rect.getWidth(), rect.getHeight());
		template.fill();
		template.restoreState();
	}
1139981
public void moveRectangleTo(Rectangle rect, float x, float y) {
		float width = rect.getWidth();
		float height = rect.getHeight();
		rect.setLeft(x);
		rect.setBottom(y);
		rect.setRight(rect.getLeft() + width);
		rect.setTop(rect.getBottom() + height);
	}
501351
function draw(c, frame)
{
    const pixels = frame.data
    for (let y = 0; y < frame.height; y++)
    {
        for (let x = 0; x < frame.width; x++)
        {
            const color = pixels[x + y * frame.width]
            if (typeof color !== 'undefined')
            {
                let hex = color.toString(16)
                while (hex.length < 6)
                {
                    hex = '0' + hex
                }
                c.fillStyle = '#' + hex
                c.beginPath()
                c.fillRect(x, y, 1, 1)
            }
        }
    }
}
726952
function _drawLine(v0, v1, color) {
        var p = new Primitive();

        p.vertices = [v0, v1];
        p.color = toColor(color);

        renderer.addPrimitive(p);
    }
978116
public void setLineWidth(float width) {
		predraw();
		this.lineWidth = width;
		LSR.setWidth(width);
		GL.glPointSize(width);
		postdraw();
	}
903864
private void drawInterfere(Graphics g, int x1, int y1, int x2, int y2, int thickness, Color c) {

		// The thick line is in fact a filled polygon
		g.setColor(c);
		int dX = x2 - x1;
		int dY = y2 - y1;
		// line length
		double lineLength = Math.sqrt(dX * dX + dY * dY);

		double scale = (double) (thickness) / (2 * lineLength);

		// The x and y increments from an endpoint needed to create a
		// rectangle...
		double ddx = -scale * (double) dY;
		double ddy = scale * (double) dX;
		ddx += (ddx > 0) ? 0.5 : -0.5;
		ddy += (ddy > 0) ? 0.5 : -0.5;
		int dx = (int) ddx;
		int dy = (int) ddy;

		// Now we can compute the corner points...
		int xPoints[] = new int[4];
		int yPoints[] = new int[4];

		xPoints[0] = x1 + dx;
		yPoints[0] = y1 + dy;
		xPoints[1] = x1 - dx;
		yPoints[1] = y1 - dy;
		xPoints[2] = x2 - dx;
		yPoints[2] = y2 - dy;
		xPoints[3] = x2 + dx;
		yPoints[3] = y2 + dy;

		g.fillPolygon(xPoints, yPoints, 4);
	}
669211
def draw_rectangle(x, y, width, height, attr = {})
            load!

            stroke_color  = attr.fetch(:stroke_color, DEFAULT_STROKE_COLOR)
            fill_color    = attr.fetch(:fill_color, DEFAULT_FILL_COLOR)
            line_cap      = attr.fetch(:line_cap, DEFAULT_LINECAP)
            line_join     = attr.fetch(:line_join, DEFAULT_LINEJOIN)
            line_width    = attr.fetch(:line_width, DEFAULT_LINEWIDTH)
            dash_pattern  = attr.fetch(:dash, DEFAULT_DASHPATTERN)

            stroke        = attr[:stroke].nil? ? true : attr[:stroke]
            fill          = attr[:fill].nil? ? false : attr[:fill]

            stroke = true if fill == false and stroke == false

            set_fill_color(fill_color) if fill
            set_stroke_color(stroke_color) if stroke
            set_line_width(line_width)
            set_line_cap(line_cap)
            set_line_join(line_join)
            set_dash_pattern(dash_pattern)

            if @canvas.gs.text_state.is_in_text_object?
                @instructions << PDF::Instruction.new('ET').render(@canvas)
            end

            @instructions << PDF::Instruction.new('re', x,y,width,height).render(@canvas)

            @instructions << (i =
                if stroke and not fill
                    PDF::Instruction.new('S')
                elsif fill and not stroke
                    PDF::Instruction.new('f')
                elsif fill and stroke
                    PDF::Instruction.new('B')
                end
            )

            i.render(@canvas)

            self
        end
1161720
def _draw_rect(self, rect, painter):
        
        c = self.editor.sideareas_color
        grad = QLinearGradient(rect.topLeft(),
                                     rect.topRight())
        if sys.platform == 'darwin':
            grad.setColorAt(0, c.lighter(100))
            grad.setColorAt(1, c.lighter(110))
            outline = c.darker(110)
        else:
            grad.setColorAt(0, c.lighter(110))
            grad.setColorAt(1, c.lighter(130))
            outline = c.darker(100)
        painter.fillRect(rect, grad)
        painter.setPen(QPen(outline))
        painter.drawLine(rect.topLeft() +
                         QPointF(1, 0),
                         rect.topRight() -
                         QPointF(1, 0))
        painter.drawLine(rect.bottomLeft() +
                         QPointF(1, 0),
                         rect.bottomRight() -
                         QPointF(1, 0))
        painter.drawLine(rect.topRight() +
                         QPointF(0, 1),
                         rect.bottomRight() -
                         QPointF(0, 1))
        painter.drawLine(rect.topLeft() +
                         QPointF(0, 1),
                         rect.bottomLeft() -
                         QPointF(0, 1))