I have actually traced the source of the problem. It happens because Geany and the `GtkColorSelection` take the same underlying `GdkColor` (0..65535 resolution) and use *different* algorithms to convert it to `#RRGGBB` (0..255 resolution), resulting in a slight discrepancy between what’s shown in the dialog and what’s inserted into the document.
This can be fixed by switching [the two lines in `utils_scale_round`](https://github.com/geany/geany/blob/35a5d457f48c92ecb71b5a2ecf7d718701d5ef63...) and [invoking it](https://github.com/geany/geany/blob/35a5d457f48c92ecb71b5a2ecf7d718701d5ef63...) like `utils_scale_round(... / 65535.0, 255)`. This gives me consistently the same result between Geany and GTK+. (See also `gtk/gtkcolorsel.c`, function `scale_round`.)
The only question, then, is why was the correct line in `utils_scale_round` commented out and replaced with a less correct one. But this [happened before the initial Git import](https://github.com/geany/geany/blob/8cb2cf0997409ec0397efb9554818a733d13f93c...), so probably nobody knows anymore.