From 0ef0530861037b48ff3f74cedfcb40d1342b5dc0 Mon Sep 17 00:00:00 2001 From: Rick van Hattem Date: Wed, 10 Aug 2016 06:52:42 +0200 Subject: [PATCH] display the currently selected color in color (#163) --- assets/webconfig/js/app/views/MainView.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/assets/webconfig/js/app/views/MainView.js b/assets/webconfig/js/app/views/MainView.js index 986af3fa..b4822292 100644 --- a/assets/webconfig/js/app/views/MainView.js +++ b/assets/webconfig/js/app/views/MainView.js @@ -353,7 +353,13 @@ define([ rgb.g = Math.round(rgb.g * this.brightness); rgb.b = Math.round(rgb.b * this.brightness); - this.inputbox.value = tools.b2hexstr(rgb.r) + tools.b2hexstr(rgb.g) + tools.b2hexstr(rgb.b); + this.inputbox.value = this.inputbox.style.backgroundColor = ( + '#' + + tools.b2hexstr(rgb.r) + + tools.b2hexstr(rgb.g) + + tools.b2hexstr(rgb.b) + ); + this.inputbox.style.color = (rgb.r + rgb.g + rgb.b) < 384 ? '#fff' : '#000'; }, /**