diff --git a/copyparty/web/browser.html b/copyparty/web/browser.html
index 14792e08..9ce3aaeb 100644
--- a/copyparty/web/browser.html
+++ b/copyparty/web/browser.html
@@ -296,7 +296,6 @@
CGV = {{ cgv|tojson }},
TS = "{{ ts }}",
dtheme = "{{ dtheme }}",
- tcolor = "#{{ tcolor }}"
lang = "{{ lang }}",
dfavico = "{{ favico }}",
have_tags_idx = {{ have_tags_idx }},
diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js
index 4a7e583b..c29aea67 100644
--- a/copyparty/web/browser.js
+++ b/copyparty/web/browser.js
@@ -1480,21 +1480,6 @@ if(sread('cfg_lgcy') == 'true')
ebi('reloc_cfg').click();
// accent color
-function parseColor (strColor) {
- var s = new Option().style;
- s.color = strColor;
- return s.color !== '' ? s.color : '';
-}
-function setColor (color) {
- accent = color;
- swrite('accent', accent);
- var a = accent || '';
- console.log('accent color set to: ' + a);
- document.documentElement.style.setProperty('--a', a);
- pbar.drawbuf();
- pbar.drawpos();
- vbar.draw();
-}
ebi('accent').oninput = ebi('accent_picker').oninput = function () {
var validcolor = parseColor(this.value);
console.log(this.value);
@@ -1516,14 +1501,6 @@ ebi('accent').oninput = ebi('accent_picker').oninput = function () {
setColor(validcolor);
}, 100);
}
-var accent = sread('accent');
-if(!accent || accent.length <= 3)
- accent = window.tcolor;
-if(accent && accent.length > 3){
- console.log('read accent color from settings: ' + accent);
- document.documentElement.style.setProperty('--a', parseColor(accent));
- ebi('accent').value = ebi('accent_picker').value = accent;
-}
// corner radius
ebi('radius').oninput = function () {
diff --git a/copyparty/web/util.js b/copyparty/web/util.js
index 5a6c24be..ee6fa110 100644
--- a/copyparty/web/util.js
+++ b/copyparty/web/util.js
@@ -2346,6 +2346,35 @@ function cprop(name) {
return getComputedStyle(document.documentElement).getPropertyValue(name);
}
+// read accent / theme color
+function parseColor (strColor) {
+ var s = new Option().style;
+ s.color = strColor;
+ return s.color !== '' ? s.color : '';
+}
+function setColor (color) {
+ accent = color;
+ swrite('accent', accent);
+ var a = accent || '';
+ console.log('accent color set to: ' + a);
+ document.documentElement.style.setProperty('--a', a);
+ pbar.drawbuf();
+ pbar.drawpos();
+ vbar.draw();
+}
+var accent = sread('accent');
+var tcolor = QS('meta[name=theme-color]');
+if(tcolor)
+ tcolor = tcolor.content;
+if((!accent || accent.length <= 3) && tcolor != "#333333")
+ accent = tcolor;
+var thing = QS('meta[name=theme-color]');
+if(accent && accent.length > 3){
+ console.log('read accent color from settings: ' + accent);
+ document.documentElement.style.setProperty('--a', parseColor(accent));
+ if(ebi('accent'))
+ ebi('accent').value = ebi('accent_picker').value = accent;
+}
function bchrome() {
var v, o = QS('meta[name=theme-color]');