From 387e3c5f9955e4f811d03acaf9ab752a20e541cd Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 6 Apr 2019 19:19:46 +0200 Subject: [PATCH] Add more compile time GUI color options Add more compile time GUI color options (#5586) --- sonoff/my_user_config.h | 8 ++++++++ sonoff/xdrv_01_webserver.ino | 18 +++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/sonoff/my_user_config.h b/sonoff/my_user_config.h index 97a43836f..7258f893a 100644 --- a/sonoff/my_user_config.h +++ b/sonoff/my_user_config.h @@ -261,11 +261,19 @@ #define COLOR_TEXT "#000" // Global text color - Black #define COLOR_BACKGROUND "#fff" // Global background color - White #define COLOR_FORM "#f2f2f2" // Form background color - Greyish + #define COLOR_INPUT_TEXT "#000" // Input text color - Black + #define COLOR_INPUT "#fff" // Input background color - White + #define COLOR_CONSOLE_TEXT "#000" // Console text color - Black + #define COLOR_CONSOLE "#fff" // Console background color - White // White text on black/greyish background (alternative) // #define COLOR_TEXT "#fff" // Global text color - White // #define COLOR_BACKGROUND "#000" // Global background color - Black // #define COLOR_FORM "#4f4f4f" // Form background color - Greyish +// #define COLOR_INPUT_TEXT "#000" // Input text color - Black +// #define COLOR_INPUT "#ddd" // Input background color - Greyish +// #define COLOR_CONSOLE_TEXT "green" // Console text color - Green +// #define COLOR_CONSOLE "#111" // Console background color - Blackish #define COLOR_TEXT_WARNING "red" // Warning text color - Red #define COLOR_TEXT_SUCCESS "green" // Success text color - Green diff --git a/sonoff/xdrv_01_webserver.ino b/sonoff/xdrv_01_webserver.ino index ff5672093..c45d65d96 100644 --- a/sonoff/xdrv_01_webserver.ino +++ b/sonoff/xdrv_01_webserver.ino @@ -46,6 +46,18 @@ #ifndef COLOR_FORM #define COLOR_FORM "#f2f2f2" // Form background color - Greyish #endif +#ifndef COLOR_INPUT_TEXT +#define COLOR_INPUT_TEXT "#000" // Input text color - Black +#endif +#ifndef COLOR_INPUT +#define COLOR_INPUT "#fff" // Input background color - White +#endif +#ifndef COLOR_CONSOLE_TEXT +#define COLOR_CONSOLE_TEXT "#000" // Console text color - Black +#endif +#ifndef COLOR_CONSOLE +#define COLOR_CONSOLE "#fff" // Console background color - White +#endif #ifndef COLOR_BUTTON_TEXT #define COLOR_BUTTON_TEXT "#fff" // Button text color - White #endif @@ -278,10 +290,10 @@ const char HTTP_HEAD_STYLE1[] PROGMEM = "div,fieldset,input,select{padding:5px;font-size:1em;}" "fieldset{background-color:" COLOR_FORM ";}" // Also update HTTP_TIMER_STYLE "p{margin:0.5em 0;}" - "input{width:100%%;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;}" + "input{width:100%%;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;background-color:" COLOR_INPUT ";color:" COLOR_INPUT_TEXT ";}" "input[type=checkbox],input[type=radio]{width:1em;margin-right:6px;vertical-align:-1px;}" - "select{width:100%%;}" - "textarea{resize:none;width:98%%;height:318px;padding:5px;overflow:auto;}" + "select{width:100%%;background-color:" COLOR_INPUT ";color:" COLOR_INPUT_TEXT ";}" + "textarea{resize:none;width:98%%;height:318px;padding:5px;overflow:auto;background-color:" COLOR_CONSOLE ";color:" COLOR_CONSOLE_TEXT ";}" "body{text-align:center;font-family:verdana;background-color:" COLOR_BACKGROUND ";}" "td{padding:0px;}"; const char HTTP_HEAD_STYLE2[] PROGMEM =