mdn_colors = {
let h = html`${response_text}`;
let tables = d3.select(h).selectAll("table").nodes();
let colors = [];
d3.range(3).map((i) =>
d3
.select(tables[i])
.selectAll("tr")
.nodes()
.forEach(function (row, i) {
if (i > 0) {
let row_data = d3.select(row).selectAll("td").nodes();
if (row_data.length > 1) {
let color_name = row_data[0].innerText;
let match = color_name.match(/\(.*\)/);
if (match) {
let idx = match.index;
color_name = color_name.slice(0, idx);
}
colors.push({
color_name,
hex_value: row_data[1].innerText
});
}
}
})
);
return colors;
}