summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2025-04-23 20:06:52 +0300
committerGeorge Hazan <george.hazan@gmail.com>2025-04-23 20:06:52 +0300
commit57b62fcfdcea3687ff3419776b501a6091129739 (patch)
tree75b11ee2debd48e9e8f991080e4372ccf9b63d38
parent9bfe30d9940ed21a8465a48a9065e5c8e944ecce (diff)
fixes #4988 (NewStory: коды цветов перепутаны)
-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",