@vfaronov the `utils_scale_round` was probably changed because the first equation does not handle out of range values.
The problem is the use of binary floating point fractions to represent whole numbers with differing resolutions (a GdkColor has 16 bits per component, `#RRGGBB` has only 8), you get rounding errors, even using double.