Fix compiler warning (#1492)

This commit is contained in:
stefansjfw
2020-03-09 23:21:33 +01:00
committed by GitHub
parent 965b098d66
commit 7ac378dcd3
2 changed files with 3 additions and 3 deletions

View File

@@ -224,7 +224,7 @@ namespace ZoneWindowDrawUtils
RGB(175, 175, 185),
};
// { fillAlpha, fill, borderAlpha, border, thickness }
// ColorSetting { fillAlpha, fill, borderAlpha, border, thickness }
ColorSetting const colorHints{ 225, RGB(81, 92, 107), 255, RGB(104, 118, 138), -2 };
ColorSetting colorViewer{ OpacitySettingToAlpha(highlightOpacity), 0, 255, RGB(40, 50, 60), -2 };
ColorSetting colorHighlight{ OpacitySettingToAlpha(highlightOpacity), 0, 255, 0, -2 };

View File

@@ -140,10 +140,10 @@ inline void ParseDeviceId(PCWSTR deviceId, PWSTR parsedId, size_t size)
}
}
inline int OpacitySettingToAlpha(int opacity)
inline unsigned char OpacitySettingToAlpha(int opacity)
{
// convert percentage to a 0-255 alpha value
return static_cast<int>(opacity * 2.55);
return static_cast<unsigned char>(opacity * 2.55);
}
UINT GetDpiForMonitor(HMONITOR monitor) noexcept;