Improve how the colouring is showed in html (ttytheme)

Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
This commit is contained in:
Ari Archer 2022-08-17 01:16:32 +03:00
parent 5bf25117b9
commit 368c649f89

View file

@ -53,7 +53,10 @@ export function generate_theme(query = "#theme-output") {
document.body.style.backgroundColor = `rgb(${tty_clrs["black"].rgb.join( document.body.style.backgroundColor = `rgb(${tty_clrs["black"].rgb.join(
"," ","
)})`; )})`;
document.body.style.color = `rgb(${tty_clrs["bold_white"].rgb.join(",")})`; document.body.style.color = `rgb(${tty_clrs["light_gray"].rgb.join(",")})`;
for (let header of document.querySelectorAll("h1, h2:first-of-type"))
header.style.color = `rgb(${tty_clrs["bold_white"].rgb.join(",")})`;
let elem = document.querySelector(query); let elem = document.querySelector(query);
if (!elem) throw ReferenceError(`${query} did not match any results`); if (!elem) throw ReferenceError(`${query} did not match any results`);