0 votes
in Image Classification by
Can you write a code snippet to create a basic SVG shape, such as a circle or rectangle?

1 Answer

0 votes
by

Sure, here’s a simple SVG code snippet to create a circle:

<svg width="100" height="100">

  <circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />

</svg>

In this example, the ‘svg’ tag defines the SVG canvas with a width and height of 100. The ‘circle’ tag creates a circle shape. The attributes ‘cx’ and ‘cy’ define the x and y coordinates of the center of the circle respectively. The ‘r’ attribute specifies the radius of the circle. The ‘stroke’ attribute sets the color of the circle border, while ‘stroke-width’ determines its thickness. The ‘fill’ attribute sets the interior color of the circle.

...