/* Customize the background colors and border radii for each div */
<h3>New Twitter X Svg Icon with Different Background Color</h3>
<svg height='100' viewBox="0 0 300 300" version="1.1" xmlns="http://www.w3.org/2000/svg">
d="M178.57 127.15 290.27 0h-26.46l-97.03 110.38L89.34 0H0l117.13 166.93L0 300.25h26.46l102.4-116.59 81.8 116.59h89.34M36.01 19.54H76.66l187.13 262.13h-40.66" />
<svg height='100' viewBox="0 0 300 300" version="1.1" xmlns="http://www.w3.org/2000/svg">
d="M178.57 127.15 290.27 0h-26.46l-97.03 110.38L89.34 0H0l117.13 166.93L0 300.25h26.46l102.4-116.59 81.8 116.59h89.34M36.01 19.54H76.66l187.13 262.13h-40.66" />
<svg height='100' viewBox="0 0 300 300" version="1.1" xmlns="http://www.w3.org/2000/svg">
d="M178.57 127.15 290.27 0h-26.46l-97.03 110.38L89.34 0H0l117.13 166.93L0 300.25h26.46l102.4-116.59 81.8 116.59h89.34M36.01 19.54H76.66l187.13 262.13h-40.66" />
<svg height='100' viewBox="0 0 300 300" version="1.1" xmlns="http://www.w3.org/2000/svg">
d="M178.57 127.15 290.27 0h-26.46l-97.03 110.38L89.34 0H0l117.13 166.93L0 300.25h26.46l102.4-116.59 81.8 116.59h89.34M36.01 19.54H76.66l187.13 262.13h-40.66" />
<svg height='100' viewBox="0 0 300 300" version="1.1" xmlns="http://www.w3.org/2000/svg">
d="M178.57 127.15 290.27 0h-26.46l-97.03 110.38L89.34 0H0l117.13 166.93L0 300.25h26.46l102.4-116.59 81.8 116.59h89.34M36.01 19.54H76.66l187.13 262.13h-40.66" />
<svg height='100' viewBox="0 0 300 300" version="1.1" xmlns="http://www.w3.org/2000/svg">
d="M178.57 127.15 290.27 0h-26.46l-97.03 110.38L89.34 0H0l117.13 166.93L0 300.25h26.46l102.4-116.59 81.8 116.59h89.34M36.01 19.54H76.66l187.13 262.13h-40.66" />
<svg height='100' viewBox="0 0 300 300" version="1.1" xmlns="http://www.w3.org/2000/svg">
d="M178.57 127.15 290.27 0h-26.46l-97.03 110.38L89.34 0H0l117.13 166.93L0 300.25h26.46l102.4-116.59 81.8 116.59h89.34M36.01 19.54H76.66l187.13 262.13h-40.66" />
<svg height='100' viewBox="0 0 300 300" version="1.1" xmlns="http://www.w3.org/2000/svg">
d="M178.57 127.15 290.27 0h-26.46l-97.03 110.38L89.34 0H0l117.13 166.93L0 300.25h26.46l102.4-116.59 81.8 116.59h89.34M36.01 19.54H76.66l187.13 262.13h-40.66" />
<svg height='100' viewBox="0 0 300 300" version="1.1" xmlns="http://www.w3.org/2000/svg">
d="M178.57 127.15 290.27 0h-26.46l-97.03 110.38L89.34 0H0l117.13 166.93L0 300.25h26.46l102.4-116.59 81.8 116.59h89.34M36.01 19.54H76.66l187.13 262.13h-40.66" />
function copySvgCode(iconNumber) {
const svgElement = document.querySelector(`div:nth-child(${iconNumber}) svg`);
const svgCode = new XMLSerializer().serializeToString(svgElement);
const tempTextarea = document.createElement('textarea');
tempTextarea.value = svgCode;
document.body.appendChild(tempTextarea);
document.execCommand('copy');
document.body.removeChild(tempTextarea);
alert('SVG Code copied to clipboard!');
function downloadPng(iconNumber) {
const svgElement = document.querySelector(`div:nth-child(${iconNumber}) svg`);
const svgCode = new XMLSerializer().serializeToString(svgElement);
const canvas = document.createElement('canvas');
canvas.width = svgElement.clientWidth;
canvas.height = svgElement.clientHeight;
const ctx = canvas.getContext('2d');
img.onload = function () {
ctx.drawImage(img, 0, 0);
const downloadLink = document.createElement('a');
downloadLink.download = `icon_${iconNumber}.png`;
downloadLink.href = canvas.toDataURL('image/png');
img.src = 'data:image/svg+xml;base64,' + btoa(unescape(encodeURIComponent(svgCode)));