summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/NewStory/src/templates.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/NewStory/src/templates.cpp b/plugins/NewStory/src/templates.cpp
index e90586059e..7e3cb22d8c 100644
--- a/plugins/NewStory/src/templates.cpp
+++ b/plugins/NewStory/src/templates.cpp
@@ -55,6 +55,11 @@ static builtinColors[] = {
{ L"silver", RGB(192, 192, 192) },
};
+static uint32_t color2html(COLORREF clr)
+{
+ return (((clr & 0xFF) << 16) | (clr & 0xFF00) | ((clr & 0xFF0000) >> 16));
+}
+
static int str2color(const CMStringW &str)
{
for (auto &it : builtinColors)
@@ -69,17 +74,12 @@ static int str2color(const CMStringW &str)
if (!is_hex_digit(str[i]))
return -1;
- return wcstoul(str, 0, 16);
+ return color2html(wcstoul(str, 0, 16));
}
///////////////////////////////////////////////////////////////////////////////
// HTML generator
-static uint32_t color2html(COLORREF clr)
-{
- return (((clr & 0xFF) << 16) | (clr & 0xFF00) | ((clr & 0xFF0000) >> 16));
-}
-
static wchar_t* font2html(LOGFONTA &lf, wchar_t *dest)
{
mir_snwprintf(dest, 100, L"font-family: %S; font-size: %dpt; font-weight: %s %s",