l4l: fix colors

Origin commit data
------------------
Branch: ni/coolstream
Commit: 79ea922445
Author: TangoCash <eric@loxat.de>
Date: 2018-12-24 (Mon, 24 Dec 2018)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
TangoCash
2018-12-24 23:43:45 +01:00
committed by vanhofen
parent a43f04cfb3
commit 2b1b106125
2 changed files with 13 additions and 16 deletions

View File

@@ -290,11 +290,10 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
}
/* ----------------------------------------------------------------- */
std::string fgcolor = hexStr(&t.infobar_Text_red)
+ hexStr(&t.infobar_Text_green)
+ hexStr(&t.infobar_Text_blue)
+ hexStr(&t.infobar_Text_alpha);
std::string fgcolor = hexStr(t.infobar_Text_red)
+ hexStr(t.infobar_Text_green)
+ hexStr(t.infobar_Text_blue)
+ hexStr(t.infobar_Text_alpha);
if (m_fgcolor.compare(fgcolor))
{
@@ -304,10 +303,10 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
/* ----------------------------------------------------------------- */
std::string bgcolor = hexStr(&t.infobar_red)
+ hexStr(&t.infobar_green)
+ hexStr(&t.infobar_blue)
+ hexStr(&t.infobar_alpha);
std::string bgcolor = hexStr(t.infobar_red)
+ hexStr(t.infobar_green)
+ hexStr(t.infobar_blue)
+ hexStr(t.infobar_alpha);
if (m_bgcolor.compare(bgcolor))
{
@@ -1025,11 +1024,9 @@ void CLCD4l::strReplace(std::string &orig, const std::string &fstr, const std::s
}
}
std::string CLCD4l::hexStr(unsigned char* data)
std::string CLCD4l::hexStr(unsigned char data)
{
std::stringstream ss;
ss << std::hex;
for(int i=0; i<1; ++i)
ss << std::setw(2) << std::setfill('0') << (int)data[i];
return ss.str();
char hexstr[3];
snprintf(hexstr, sizeof hexstr, "%02x", (int)data * 255 / 100);
return std::string(hexstr);
}

View File

@@ -67,7 +67,7 @@ class CLCD4l
uint64_t GetParseID();
bool CompareParseID(uint64_t &i_ParseID);
std::string hexStr(unsigned char* data);
std::string hexStr(unsigned char data);
void strReplace(std::string &orig, const std::string &fstr, const std::string &rstr);
bool WriteFile(const char *file, std::string content = "", bool convert = false);