From 9d45dd812f6f6a25b07121c46e6e3d0ce96e2e78 Mon Sep 17 00:00:00 2001 From: kleonc <9283098+kleonc@users.noreply.github.com> Date: Tue, 11 Jul 2023 21:30:50 +0200 Subject: [PATCH] Fix byte to float color conversion in DisplayServerWindows::screen_get_pixel --- platform/windows/display_server_windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 4138f53a9d9b..757e05c8d7bc 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -618,7 +618,7 @@ Color DisplayServerWindows::screen_get_pixel(const Point2i &p_position) const { COLORREF col = GetPixel(dc, p.x, p.y); if (col != CLR_INVALID) { ReleaseDC(NULL, dc); - return Color(float(col & 0x000000FF) / 256.0, float((col & 0x0000FF00) >> 8) / 256.0, float((col & 0x00FF0000) >> 16) / 256.0, 1.0); + return Color(float(col & 0x000000FF) / 255.0f, float((col & 0x0000FF00) >> 8) / 255.0f, float((col & 0x00FF0000) >> 16) / 255.0f, 1.0f); } ReleaseDC(NULL, dc); }