This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var colorCache = Array(); | |
function randomColor() { | |
const r = () => 200 + Math.floor(56 * Math.random()); //Strong color | |
var rl = Array(); | |
do { | |
rl[0] = r(); | |
rl[1] = r() - 50 - Math.floor(206 * Math.random()); // Clearer defined color | |
rl[2] = r() - 50 - Math.floor(50 * Math.random()); | |
rl.sort(function() { | |
return 0.5 - Math.random(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hoverByClass(classname,colorover,colorout="transparent"){ | |
var elms=document.getElementsByClassName(classname); | |
for(var i=0;i<elms.length;i++){ | |
elms[i].onmouseover = function(){ | |
for(var k=0;k<elms.length;k++){ | |
elms[k].style.backgroundColor=colorover; | |
} | |
}; | |
elms[i].onmouseout = function(){ | |
for(var k=0;k<elms.length;k++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta name="theme-color" content="#FF0000"> | |
<script> | |
// https://stackoverflow.com/a/44134328/4346956 | |
// https://gordonlesti.com/change-theme-color-via-javascript/ | |
function hslToHex(h, s, l) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>Title</title> | |
<style> | |
body { | |
margin: 0px; | |
height: 100%; | |
width: 100%; |