MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / ReadColor

Method ReadColor

WinArk/IniFile.cpp:29–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29COLORREF IniFile::ReadColor(PCWSTR section, PCWSTR name, COLORREF defaultValue) {
30 auto text = ReadString(section, name);
31 if (text.IsEmpty())
32 return defaultValue;
33
34 if (text.Left(2) == L"0x")
35 return ParseHexColor(text.Mid(2));
36
37 if (text.Find(L','))
38 return ParseDecColor(text);
39
40 return ParseHexColor(text);
41}
42
43COLORREF IniFile::ParseHexColor(const CString& hex) {
44 std::wstringstream ss;

Callers 1

LoadColorsFunction · 0.80

Calls 2

IsEmptyMethod · 0.80
FindMethod · 0.80

Tested by

no test coverage detected