Fixes #1527 as discussed there.

In `win32_show_color_dialog`, `utils_scale_round` is not necessary at all 
because 
[`Get{R,G,B}Value`](https://msdn.microsoft.com/en-us/library/windows/desktop/dd144923.aspx)
 already return 0..255, which we can immediately render as hex.

The resulting code behaves correctly for me under all configurations: Linux and 
Windows, GTK+2 and GTK+3, with or without native Windows dialogs. (The native 
[Windows color dialog](https://i-msdn.sec.s-msft.com/dynimg/IC534143.png) does 
not show `#RRGGBB`, but it does show the individual R, G, B bytes, and I 
checked against those.)

However, I still have no idea why @elextr was unable to reproduce #1527 while I 
can easily reproduce it in all configurations (with GTK+ color picker).

I’m also not sure why I remember not having this issue in the past, but it’s 
likely that I only used the color chooser a few times back then, so I may have 
missed it.
You can view, comment on, or merge this pull request online at:

  https://github.com/geany/geany/pull/1536

-- Commit Summary --

  * Fix converting color to hex for insertion

-- File Changes --

    M src/utils.c (14)
    M src/win32.c (5)

-- Patch Links --

https://github.com/geany/geany/pull/1536.patch
https://github.com/geany/geany/pull/1536.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1536

Reply via email to