diff --git a/src/App.vue b/src/App.vue
index f3039e26..2db0648f 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,4 +1,4 @@
-
-
+
-
-
-
-
-
-
+
+
+
+
@@ -84,6 +86,26 @@ export default class App extends Mixins(BaseMixin) {
return this.$store.state.gui.theme.primary
}
+ get primaryTextColor() {
+ let splits = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(this.primaryColor)
+ if (splits) {
+ const r = parseInt(splits[1], 16) * 0.2126
+ const g = parseInt(splits[2], 16) * 0.7152
+ const b = parseInt(splits[3], 16) * 0.0722
+ const perceivedLightness = (r + g + b) / 255
+
+ return perceivedLightness > 0.7 ? '#222' : '#fff'
+ }
+
+ return '#ffffff'
+ }
+
+ get cssVars() {
+ return {
+ '--v-btn-text-primary': this.primaryTextColor
+ }
+ }
+
@Watch('language')
languageChanged(newVal: string) {
this.$i18n.locale = newVal;