Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
CString strColor;
COLORREF m_rgbColor = picker.GetRGB();
strColor.Format("%02X%02X%02X",GetRValue(m_rgbColor),GetGValue(m_rgbColor),GetBValue(m_rgbColor));
int _httoi(const TCHAR *value)
{
struct CHexMap
{
TCHAR chr;
int value;
};
const int HexMapL = 16;
CHexMap HexMap[HexMapL] =
{
{'0', 0}, {'1', 1},
{'2', 2}, {'3', 3},
{'4', 4}, {'5', 5},
{'6', 6}, {'7', 7},
{'8', 8}, {'9', 9},
{'A', 10}, {'B', 11},
{'C', 12}, {'D', 13},
{'E', 14}, {'F', 15}
};
TCHAR *mstr = _tcsupr(_tcsdup(value));
TCHAR *s = mstr;
int result = 0;
if (*s == '0' && *(s + 1) == 'X') s += 2;
bool firsttime = true;
while (*s != '\0')
{
bool found = false;
for (int i = 0; i < HexMapL; i++)
{
if (*s == HexMap[i].chr)
{
if (!firsttime) result <<= 4;
result |= HexMap[i].value;
found = true;
break;
}
}
if (!found) break;
s++;
firsttime = false;
}
free(mstr);
return result;
}
COLORREF HexToRGB(CString strHex)
{
int iRed = _httoi(strHex.Left(2));
int iGreen = _httoi(strHex.Mid(2, 2));
int iBlue = _httoi(strHex.Right(2));
return RGB(iRed,iGreen,iBlue);
}
// hier siehts dann in aktion aus
CString strColor = FFFFFF;
COLORREF rgbColor;
rgbColor = HexToRGB(m_strColor);