Merge pull request #6811 from localhost61/development

Add COLOR_TITLE as WebColor19
This commit is contained in:
Theo Arends 2019-11-02 11:34:27 +01:00 committed by GitHub
commit 630393b91b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 10 deletions

View File

@ -168,6 +168,7 @@
#define COLOR_BUTTON_SAVE_HOVER "#5aaf6f" // [WebColor16] Save button color when hovered over - Darker greenish #define COLOR_BUTTON_SAVE_HOVER "#5aaf6f" // [WebColor16] Save button color when hovered over - Darker greenish
#define COLOR_TIMER_TAB_TEXT "#fff" // [WebColor17] Config timer tab text color - White #define COLOR_TIMER_TAB_TEXT "#fff" // [WebColor17] Config timer tab text color - White
#define COLOR_TIMER_TAB_BACKGROUND "#999" // [WebColor18] Config timer tab background color - Light grey #define COLOR_TIMER_TAB_BACKGROUND "#999" // [WebColor18] Config timer tab background color - Light grey
#define COLOR_TITLE_TEXT COLOR_TEXT // [WebColor19] Title text color - Whiteish
// -- mDNS ---------------------------------------- // -- mDNS ----------------------------------------
#define MDNS_ENABLED 0 // [SetOption55] Use mDNS (0 = Disable, 1 = Enable) #define MDNS_ENABLED 0 // [SetOption55] Use mDNS (0 = Disable, 1 = Enable)

View File

@ -433,8 +433,9 @@ struct SYSCFG {
uint32_t deepsleep; // E94 uint32_t deepsleep; // E94
uint16_t energy_power_delta; // E98 uint16_t energy_power_delta; // E98
uint8_t shutter_motordelay[MAX_SHUTTERS]; // E9A uint8_t shutter_motordelay[MAX_SHUTTERS]; // E9A
uint8_t free_e9e[342]; // E9E
uint8_t free_e9e[346]; // E9E uint8_t web_color2[1][3]; // FF4
uint8_t free_ff7 ; // FF7
uint32_t cfg_timestamp; // FF8 uint32_t cfg_timestamp; // FF8
uint32_t cfg_crc32; // FFC uint32_t cfg_crc32; // FFC

View File

@ -119,6 +119,9 @@
#ifndef COLOR_TIMER_TAB_BACKGROUND #ifndef COLOR_TIMER_TAB_BACKGROUND
#define COLOR_TIMER_TAB_BACKGROUND "#999" // Config timer tab background color - Light grey #define COLOR_TIMER_TAB_BACKGROUND "#999" // Config timer tab background color - Light grey
#endif #endif
#ifndef COLOR_TITLE_TEXT
#define COLOR_TITLE_TEXT COLOR_TEXT // Title text color defaults to global text color either dark or light
#endif
#ifndef IR_RCV_MIN_UNKNOWN_SIZE #ifndef IR_RCV_MIN_UNKNOWN_SIZE
#define IR_RCV_MIN_UNKNOWN_SIZE 6 // Set the smallest sized "UNKNOWN" message packets we actually care about (default 6, max 255) #define IR_RCV_MIN_UNKNOWN_SIZE 6 // Set the smallest sized "UNKNOWN" message packets we actually care about (default 6, max 255)
#endif #endif
@ -137,7 +140,7 @@ enum WebColors {
COL_INPUT_TEXT, COL_INPUT, COL_CONSOLE_TEXT, COL_CONSOLE, COL_INPUT_TEXT, COL_INPUT, COL_CONSOLE_TEXT, COL_CONSOLE,
COL_TEXT_WARNING, COL_TEXT_SUCCESS, COL_TEXT_WARNING, COL_TEXT_SUCCESS,
COL_BUTTON_TEXT, COL_BUTTON, COL_BUTTON_HOVER, COL_BUTTON_RESET, COL_BUTTON_RESET_HOVER, COL_BUTTON_SAVE, COL_BUTTON_SAVE_HOVER, COL_BUTTON_TEXT, COL_BUTTON, COL_BUTTON_HOVER, COL_BUTTON_RESET, COL_BUTTON_RESET_HOVER, COL_BUTTON_SAVE, COL_BUTTON_SAVE_HOVER,
COL_TIMER_TAB_TEXT, COL_TIMER_TAB_BACKGROUND, COL_TIMER_TAB_TEXT, COL_TIMER_TAB_BACKGROUND, COL_TITLE,
COL_LAST }; COL_LAST };
const char kWebColors[] PROGMEM = const char kWebColors[] PROGMEM =
@ -145,7 +148,7 @@ const char kWebColors[] PROGMEM =
COLOR_INPUT_TEXT "|" COLOR_INPUT "|" COLOR_CONSOLE_TEXT "|" COLOR_CONSOLE "|" COLOR_INPUT_TEXT "|" COLOR_INPUT "|" COLOR_CONSOLE_TEXT "|" COLOR_CONSOLE "|"
COLOR_TEXT_WARNING "|" COLOR_TEXT_SUCCESS "|" COLOR_TEXT_WARNING "|" COLOR_TEXT_SUCCESS "|"
COLOR_BUTTON_TEXT "|" COLOR_BUTTON "|" COLOR_BUTTON_HOVER "|" COLOR_BUTTON_RESET "|" COLOR_BUTTON_RESET_HOVER "|" COLOR_BUTTON_SAVE "|" COLOR_BUTTON_SAVE_HOVER "|" COLOR_BUTTON_TEXT "|" COLOR_BUTTON "|" COLOR_BUTTON_HOVER "|" COLOR_BUTTON_RESET "|" COLOR_BUTTON_RESET_HOVER "|" COLOR_BUTTON_SAVE "|" COLOR_BUTTON_SAVE_HOVER "|"
COLOR_TIMER_TAB_TEXT "|" COLOR_TIMER_TAB_BACKGROUND; COLOR_TIMER_TAB_TEXT "|" COLOR_TIMER_TAB_BACKGROUND "|" COLOR_TITLE_TEXT;
/*********************************************************************************************\ /*********************************************************************************************\
* RTC memory * RTC memory

View File

@ -883,15 +883,23 @@ void WebHexCode(uint32_t i, const char* code)
color = w | (w << 4); // 00112233 color = w | (w << 4); // 00112233
} }
*/ */
uint32_t j = sizeof(Settings.web_color)/3; // First area contains j=18 colors
if (i < j) {
Settings.web_color[i][0] = (color >> 16) & 0xFF; // Red Settings.web_color[i][0] = (color >> 16) & 0xFF; // Red
Settings.web_color[i][1] = (color >> 8) & 0xFF; // Green Settings.web_color[i][1] = (color >> 8) & 0xFF; // Green
Settings.web_color[i][2] = color & 0xFF; // Blue Settings.web_color[i][2] = color & 0xFF; // Blue
} else {
Settings.web_color2[i-j][0] = (color >> 16) & 0xFF; // Red
Settings.web_color2[i-j][1] = (color >> 8) & 0xFF; // Green
Settings.web_color2[i-j][2] = color & 0xFF; // Blue
}
} }
uint32_t WebColor(uint32_t i) uint32_t WebColor(uint32_t i)
{ {
uint32_t tcolor = (Settings.web_color[i][0] << 16) | (Settings.web_color[i][1] << 8) | Settings.web_color[i][2]; uint32_t j = sizeof(Settings.web_color)/3; // First area contains j=18 colors
uint32_t tcolor = (i<j)? (Settings.web_color[i][0] << 16) | (Settings.web_color[i][1] << 8) | Settings.web_color[i][2] :
(Settings.web_color2[i-j][0] << 16) | (Settings.web_color2[i-j][1] << 8) | Settings.web_color2[i-j][2];
return tcolor; return tcolor;
} }

View File

@ -364,7 +364,7 @@ const char HTTP_HEAD_STYLE3[] PROGMEM =
#ifdef FIRMWARE_MINIMAL #ifdef FIRMWARE_MINIMAL
"<div style='text-align:center;color:#%06x;'><h3>" D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "</h3></div>" // COLOR_TEXT_WARNING "<div style='text-align:center;color:#%06x;'><h3>" D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "</h3></div>" // COLOR_TEXT_WARNING
#endif #endif
"<div style='text-align:center;'><noscript>" D_NOSCRIPT "<br></noscript>" "<div style='text-align:center;color:#%06x;'><noscript>" D_NOSCRIPT "<br></noscript>" // COLOR_TITLE
#ifdef LANGUAGE_MODULE_NAME #ifdef LANGUAGE_MODULE_NAME
"<h3>" D_MODULE " %s</h3>" "<h3>" D_MODULE " %s</h3>"
#else #else
@ -832,6 +832,7 @@ void WSContentSendStyle_P(const char* formatP, ...)
#ifdef FIRMWARE_MINIMAL #ifdef FIRMWARE_MINIMAL
WebColor(COL_TEXT_WARNING), WebColor(COL_TEXT_WARNING),
#endif #endif
WebColor(COL_TITLE),
ModuleName().c_str(), Settings.friendlyname[0]); ModuleName().c_str(), Settings.friendlyname[0]);
if (Settings.flag3.gui_hostname_ip) { if (Settings.flag3.gui_hostname_ip) {
bool lip = (static_cast<uint32_t>(WiFi.localIP()) != 0); bool lip = (static_cast<uint32_t>(WiFi.localIP()) != 0);