1 Commits

Author SHA1 Message Date
siinus
f5a70470d2 Replace hexToRgb function to work with legacy mobile browsers 2021-03-19 20:37:11 +02:00

View File

@@ -7,11 +7,15 @@
<link rel="stylesheet" href="custom.css">
<script type="text/javascript">
const hexToRgb = hex =>
hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i
,(m, r, g, b) => '#' + r + r + g + g + b + b)
.substring(1).match(/.{2}/g)
.map(x => parseInt(x, 16));
function hexToRgb(value) {
var aRgbHex = value.substring(1).match(/.{1,2}/g);
var aRgb = [
parseInt(aRgbHex[0], 16),
parseInt(aRgbHex[1], 16),
parseInt(aRgbHex[2], 16)
];
return aRgb;
}
function show_loading(visible) {
document.getElementById('loading').style.visibility = visible ? 'visible' : 'hidden';