mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 10:04:19 +02:00
contrib/logo-color: support settings the background
This commit is contained in:
parent
51a7453e6c
commit
8dc0475108
|
@ -1,5 +1,12 @@
|
||||||
|
function invertHex(hex) {
|
||||||
|
return (Number("0x1" + hex) ^ 0xffffff).toString(16).substr(1);
|
||||||
|
}
|
||||||
|
|
||||||
function color() {
|
function color() {
|
||||||
var svg = document.querySelector(".logo").getSVGDocument();
|
var svg = document.querySelector(".logo").getSVGDocument();
|
||||||
svg.getElementById("dark-1").setAttribute("stop-color", document.getElementById("color1").value);
|
svg.getElementById("dark-1").setAttribute("stop-color", document.getElementById("color1").value);
|
||||||
svg.getElementById("dark-2").setAttribute("stop-color", document.getElementById("color2").value);
|
svg.getElementById("dark-2").setAttribute("stop-color", document.getElementById("color2").value);
|
||||||
|
var background = document.getElementById("color3").value;
|
||||||
|
svg.getElementById("background").setAttribute("fill", background);
|
||||||
|
svg.getElementById("hexagon").setAttribute("stroke", "#" + invertHex(background.substring(1)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,8 @@ something that differentiates? Color it!</p>
|
||||||
|
|
||||||
<p>Select the colors here:
|
<p>Select the colors here:
|
||||||
<input id="color1" type="color" value="#222222" onchange="color();">
|
<input id="color1" type="color" value="#222222" onchange="color();">
|
||||||
<input id="color2" type="color" value="#444444" onchange="color();"></p>
|
<input id="color2" type="color" value="#444444" onchange="color();">
|
||||||
|
<input id="color3" type="color" value="#ffffff" onchange="color();"></p>
|
||||||
|
|
||||||
<p>Then right-click, click "<i>Take Screenshot</i>" and finally select the
|
<p>Then right-click, click "<i>Take Screenshot</i>" and finally select the
|
||||||
logo and download it.</p>
|
logo and download it.</p>
|
||||||
|
|
Loading…
Reference in a new issue