function getCorner(idx) {
const cornerSize = 8;
const row = Array.from(table.getElementsByTagName("tr")[0].childNodes);
const size = row.length;
let ox = 0;
let oy = 0;
let oox = 0;
let ooy = 0;
if (idx === 1) {
oy = size - cornerSize;
ooy = 1;
}
if (idx === 2) {
ox = size - cornerSize;
oox = 1;
}
const unit = 1 / size;
const g = document.createElementNS("http://www.w3.org/2000/svg", "g");
const rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
rect.setAttribute("x", unit * ox);
rect.setAttribute("y", unit * oy);
rect.setAttribute("width", unit * cornerSize);
rect.setAttribute("height", unit * cornerSize);
rect.setAttribute("fill", backColor.toString());
const rect2 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
rect2.setAttribute("x", unit * (ox + oox));
rect2.setAttribute("y", unit * (oy + ooy));
rect2.setAttribute("width", unit * 7);
rect2.setAttribute("height", unit * 7);
rect2.setAttribute("fill", ringColor.toString());
const rect3 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
rect3.setAttribute("x", unit * (1 + ox + oox));
rect3.setAttribute("y", unit * (1 + oy + ooy));
rect3.setAttribute("width", unit * 5);
rect3.setAttribute("height", unit * 5);
rect3.setAttribute("fill", backColor.toString());
const rect4 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
rect4.setAttribute("x", unit * (2 + ox + oox));
rect4.setAttribute("y", unit * (2 + oy + ooy));
rect4.setAttribute("width", unit * 3);
rect4.setAttribute("height", unit * 3);
rect4.setAttribute("fill", dotColor.toString());
g.appendChild(rect);
g.appendChild(rect2);
g.appendChild(rect3);
g.appendChild(rect4);
return g;
}