draw and fill circle
@param {number} x0 - x-center
@param {number} y0 - y-center
@param {number} radius - radius
@param {string} color
@param {CanvasRenderingContext2D} [c]
480190
function (x0, y0, radius, color, c)
    {
        _c = c || _c
        if (color)
        {
            _c.fillStyle = color
        }
        x0 *= _scale
        y0 *= _scale
        radius *= _scale
        let x = radius
        let y = 0
        let decisionOver2 = 1 - x   // Decision criterion divided by 2 evaluated at x=r, y=0

        while (x >= y)
        {
            box(-x + x0, y + y0, x * 2, 1)
            box(-y + x0, x + y0, y * 2, 1)
            box(-x + x0, -y + y0, x * 2, 1)
            box(-y + x0, -x + y0, y * 2, 1)
            y++
            if (decisionOver2 <= 0)
            {
                decisionOver2 += 2 * y + 1 // Change in decision criterion for y -> y+1
            } else
            {
                x--
                decisionOver2 += 2 * (y - x) + 1 // Change for y -> y+1, x -> x-1
            }
        }
    }
56225
function drawUpperTriangle(d, loc) {
      if (d == "r") {
        var first = {x: 50, y: 0};
        var second = {x: 50, y: 50};
      } else {
        var first = {x: 50, y: 0};
        var second = {x: 0, y: 50};
      }
      context.beginPath();
      context.moveTo(loc.x, loc.y);
      context.lineTo(loc.x + first.x, loc.y + first.y);
      context.lineTo(loc.x + second.x, loc.y + second.y);
      context.lineTo(loc.x, loc.y);
      context.lineWidth = 1;
      context.strokeStyle = 'black';
      context.stroke();
      context.fillStyle = fill;
      context.fill();
      context.closePath();
    }
478096
def draw_circle(self, color, world_loc, world_radius, thickness=0):
    """"""
    if world_radius > 0:
      center = self.world_to_surf.fwd_pt(world_loc).round()
      radius = max(1, int(self.world_to_surf.fwd_dist(world_radius)))
      pygame.draw.circle(self.surf, color, center, radius,
                         thickness if thickness < radius else 0)
1180702
private void drawSlice(Canvas canvas, SliceValue sliceValue, float lastAngle, float angle, int mode) {
        sliceVector.set((float) (Math.cos(Math.toRadians(lastAngle + angle / 2))),
                (float) (Math.sin(Math.toRadians(lastAngle + angle / 2))));
        normalizeVector(sliceVector);
        drawCircleOval.set(originCircleOval);
        if (MODE_HIGHLIGHT == mode) {
            // Add additional touch feedback by setting bigger radius for that slice and darken color.
            drawCircleOval.inset(-touchAdditional, -touchAdditional);
            slicePaint.setColor(sliceValue.getDarkenColor());
            canvas.drawArc(drawCircleOval, lastAngle, angle, true, slicePaint);
        } else {
            slicePaint.setColor(sliceValue.getColor());
            canvas.drawArc(drawCircleOval, lastAngle, angle, true, slicePaint);
        }
    }
1342756
function () {

      function draw(color, n) {
        n = Math.max(parseInt(n), 0);

        write(' ');
        write('\u001b[' + color + 'm' + n + '\u001b[0m');
        write('\n');
      }

      draw(colors.green, this.passed);
      draw(colors.fail, this.failed);
      draw(colors.pending, this.pending + ' ');
      write('\n');

      cursor.up(this.numberOfLines);
    }
906445
function drawDataPoints() {
            let circles = svg.select('.chart-group')
                .attr('clip-path', `url(#${maskingRectangleId})`)
                .selectAll('circle')
                .data(dataPoints)
                .enter();

            if (isAnimated) {
                circles
                    .append('circle')
                    .attr('class', 'data-point data-point-highlighter')
                    .transition()
                    .delay(delay)
                    .duration(duration)
                    .ease(ease)
                    .style('stroke', (d) => nameColorMap[d.name])
                    .attr('fill', (d) => (
                        hasHollowCircles ? hollowColor : nameColorMap[d.name]
                    ))
                    .attr('fill-opacity', circleOpacity)
                    .attr('r', (d) => areaScale(d.y))
                    .attr('cx', (d) => xScale(d.x))
                    .attr('cy', (d) => yScale(d.y))
                    .style('cursor', 'pointer');
            } else {
                circles
                    .append('circle')
                    .attr('class', 'point')
                    .attr('class', 'data-point-highlighter')
                    .style('stroke', (d) => nameColorMap[d.name])
                    .attr('fill', (d) => (
                        hasHollowCircles ? hollowColor : nameColorMap[d.name]
                    ))
                    .attr('fill-opacity', circleOpacity)
                    .attr('r', (d) => areaScale(d.y))
                    .attr('cx', (d) => xScale(d.x))
                    .attr('cy', (d) => yScale(d.y))
                    .style('cursor', 'pointer');
            }
        }
1125821
def drawCircle(page, center, radius, color=None, fill=None,
               morph=None, dashes=None, width=1,
               roundCap=False, overlay=True):
    
    img = page.newShape()
    Q = img.drawCircle(Point(center), radius)
    img.finish(color=color, fill=fill, dashes=dashes, width=width,
               roundCap=roundCap, morph=morph)
    img.commit(overlay)
    return Q
630765
void draw(Canvas canvas) {
        mCanvasRect.set(0.0f, 0.0f, canvas.getWidth(), canvas.getHeight());
        switch (mShape) {
            case SHAPE_RECTANGLE:
                canvas.drawRect(mCanvasRect, mCanvasPaint);
                break;
            case SHAPE_OVAL:
                canvas.drawOval(mCanvasRect, mCanvasPaint);
                break;
            case SHAPE_STAR_3_VERTICES:
            case SHAPE_STAR_4_VERTICES:
            case SHAPE_STAR_5_VERTICES:
            case SHAPE_STAR_6_VERTICES:
                drawStar(canvas, mShape);
                break;
            case SHAPE_HEART:
                drawHeart(canvas);
                break;
        }
    }
660402
def drawStyle(self, painter, x, y, width, height, radius):
        
        if self.style() == XNode.NodeStyle.Rectangle:
            # no pinch, draw regular
            if sum(self.pinch()) == 0:
                painter.drawRoundedRect(x, y, width, height, radius, radius)
            
            # create a path to draw
            else:
                tl, tr, bl, br = self.pinch()
                path = QPainterPath()
                path.moveTo(x + tl, y)
                path.lineTo(x + width - tr, y)
                path.lineTo(x + width, y + tr)
                path.lineTo(x + width, y + height - br)
                path.lineTo(x + width - br, y + height)
                path.lineTo(x + bl, y + height)
                path.lineTo(x, y + height - bl)
                path.lineTo(x, y + tl)
                path.lineTo(x + tl, y)
                painter.drawPath(path)
        
        # draw the ellipse style
        elif self.style() == XNode.NodeStyle.Ellipse:
            painter.drawEllipse(x, y, width, height)
        
        # draw a pixmap style
        elif self.style() == XNode.NodeStyle.Pixmap:
            pmap = self.pixmap().scaled(width,
                                        height,
                                        Qt.KeepAspectRatio,
                                        Qt.SmoothTransformation)
            painter.drawPixmap(x, y, pmap)
138700
function drawRadialNumbers(context, options) {
    let radius = radialTicksRadius(context, options) - context.max * 0.15;
    let points = {};
    let i = 0;
    let s = options.majorTicks.length;
    let isAnimated = options.animationTarget !== 'needle';
    let colors = options.colorNumbers instanceof Array ?
        options.colorNumbers : new Array(s).fill(options.colorNumbers);

    let plateValueAngle = isAnimated ? -(options.value - options.minValue) /
        (options.maxValue - options.minValue) * options.ticksAngle : 0;

    if (isAnimated) {
        context.save();
        context.rotate(-drawings.radians(plateValueAngle));
    }

    context.font = drawings.font(options, 'Numbers', context.max / 200);
    context.lineWidth = 0;
    context.textAlign = 'center';
    context.textBaseline = 'middle';

    for (; i < s; ++i) {
        let angle = plateValueAngle + radialNextAngle(options,
            options.exactTicks ? options.majorTicks[i] : i, s);
        let textWidth = context.measureText(options.majorTicks[i]).width;
        let textHeight = options.fontNumbersSize;
        let textRadius = Math.sqrt(textWidth * textWidth +
            textHeight * textHeight) / 2;
        let point = drawings.radialPoint(radius - textRadius -
            options.numbersMargin / 100 * context.max,
            drawings.radians(angle));

        if (angle === 360) angle = 0;

        if (points[angle]) {
            continue; //already drawn at this place, skipping
        }

        points[angle] = true;

        context.fillStyle = colors[i];
        context.fillText(options.majorTicks[i], point.x, point.y);
    }

    isAnimated && context.restore();
}
416419
function (x, y, r) {
		var circle = this.symbol('circle');
		if (isObject(x)) {
			r = x.r;
			y = x.y;
			x = x.x;
		}
		circle.isCircle = true; // Causes x and y to mean center (#1682)
		circle.r = r;
		return circle.attr({ x: x, y: y });
	}
1138247
function createColoredCanvas(color)
{
    const canvas = document.createElement('canvas');

    canvas.width = 6;
    canvas.height = 1;

    const context = canvas.getContext('2d');

    context.fillStyle = color;
    context.fillRect(0, 0, 6, 1);

    return canvas;
}
144427
def draw_circle(ctx, x, y, radius, cairo_color):
    
    ctx.new_path()
    ctx.set_source_rgb(cairo_color.red, cairo_color.green, cairo_color.blue)
    ctx.arc(x, y, radius, 0, 2 * pi)
    ctx.fill()
497707
@Override
    protected void drawBase (Graphics2D gfx, int x, int y)
    {
        if (_active) {
            // render the sausage
            super.drawBase(gfx, x, y);

        } else {
            // render the circle
            gfx.fillOval(x, y, closedBounds.width - 1, closedBounds.height - 1);
        }
    }
590518
public void fillRect(int x, int y, int w, int h, Color c) {
        int color = c.getRGB();
        for (int i = x; i < x + w; i++) {
            for (int j = y; j < y + h; j++) {
                setIntColor(i, j, color);
            }
        }
    }
383353
function _drawSphere(pos, r, color) {
        var p = new Primitive();
        p.color = toColor(color);

        // Decreasing these angles will increase complexity of sphere.
        var dtheta = 35; var dphi = 35;

        for (var theta = -90; theta <= (90 - dtheta); theta += dtheta) {
            for (var phi = 0; phi <= (360 - dphi); phi += dphi) {
                p.vertices.push(new THREE.Vector3(
                    pos.x + r * Math.cos(theta * DEG_TO_RAD) * Math.cos(phi * DEG_TO_RAD),
                    pos.y + r * Math.cos(theta * DEG_TO_RAD) * Math.sin(phi * DEG_TO_RAD),
                    pos.z + r * Math.sin(theta * DEG_TO_RAD)
                ));

                p.vertices.push(new THREE.Vector3(
                    pos.x + r * Math.cos((theta + dtheta) * DEG_TO_RAD) * Math.cos(phi * DEG_TO_RAD),
                    pos.y + r * Math.cos((theta + dtheta) * DEG_TO_RAD) * Math.sin(phi * DEG_TO_RAD),
                    pos.z + r * Math.sin((theta + dtheta) * DEG_TO_RAD)
                ));

                p.vertices.push(new THREE.Vector3(
                    pos.x + r * Math.cos((theta + dtheta) * DEG_TO_RAD) * Math.cos((phi + dphi) * DEG_TO_RAD),
                    pos.y + r * Math.cos((theta + dtheta) * DEG_TO_RAD) * Math.sin((phi + dphi) * DEG_TO_RAD),
                    pos.z + r * Math.sin((theta + dtheta) * DEG_TO_RAD)
                ));

                if ((theta > -90) && (theta < 90)) {
                    p.vertices.push(new THREE.Vector3(
                        pos.x + r * Math.cos(theta * DEG_TO_RAD) * Math.cos((phi + dphi) * DEG_TO_RAD),
                        pos.y + r * Math.cos(theta * DEG_TO_RAD) * Math.sin((phi + dphi) * DEG_TO_RAD),
                        pos.z + r * Math.sin(theta * DEG_TO_RAD)
                    ));
                }
            }
        }

        renderer.addPrimitive(p);
    }
627935
private void paintArrowDown(Graphics2D g, JComponent c, int width, int height) {
        int xOffset = width / 2 - 3;
        int yOffset = height / 2 - 5;

        g.translate(xOffset, yOffset);

        Shape s = shapeGenerator.createArrowLeft(1, 1, 4.2, 6);

        g.setPaint(getCommonArrowPaint(s, type));
        g.fill(s);

        g.translate(-xOffset, -yOffset);
    }