adventuregamestudio / ags

AGS editor and engine source code
Other
707 stars 159 forks source link

Editor: fix Colors pane and ColorMapper to display RGB values matching the engine #2500

Closed ivan-mogilko closed 3 months ago

ivan-mogilko commented 3 months ago

Fixes #2352

This fix is purely for user interface in the editor, they do not change anything in how colors are stored, nor how they are represented in the engine.

  1. Fix ColorMapper color defining algorithm to strictly match the internal engine's algorithm. The engine uses Allegro 4 for this, where actual RGB values are found using lookup tables. This seems to result in better distribution, for example it supports pure 255,255,255, while the common conversion algorithm is restricted by 252,252,252 (iirc).
  2. On Color Finder pane display actual RGB values that will be used by the engine. This is to honestly notify user that AGS clamps RGBs to less precise 16-bit format.