mirror of
https://github.com/nymurbd/MikroTik-scripts.git
synced 2025-07-31 16:24:30 +02:00
contrib/logo-color: support settings the background
This commit is contained in:
parent
51a7453e6c
commit
8dc0475108
2 changed files with 9 additions and 1 deletions
|
@ -1,5 +1,12 @@
|
|||
function invertHex(hex) {
|
||||
return (Number("0x1" + hex) ^ 0xffffff).toString(16).substr(1);
|
||||
}
|
||||
|
||||
function color() {
|
||||
var svg = document.querySelector(".logo").getSVGDocument();
|
||||
svg.getElementById("dark-1").setAttribute("stop-color", document.getElementById("color1").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)));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue