Skip to content
  • Jehan's avatar
    app: save the accurate color in the colormap palette when possible. · f1cca8ee
    Jehan authored
    The colormap saves colors as unsigned char, which can be very inaccurate
    compared to high precision colors. When adding colors from GimpRGB into
    the colormap, use the original value to fill the colormap palette
    instead of making a round trip conversion from double to uchar, then
    back to double.
    
    This also fixes a direct bug I encountered when adding the current
    foreground color in the image colormap. Yet the GimpFgBgEditor or the
    GimpColorHistory would still show the color out-of-gamut in cases when
    the returned RGB after the roundtrip was not close enough to the
    original RGB (even despite using an epsilon in GimpPalette code).
    f1cca8ee