Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: color properties are clamping RGB values inconsistenly with the engine #2352

Open
ivan-mogilko opened this issue Mar 8, 2024 · 0 comments
Labels
ags3 related to ags3 (version with full backward compatibility) context: bw-compat supporting deprecated runtime functionality, importing and converting game data context: graphics type: bug unexpected/erroneous behavior in the existing functionality what: editor related to the game editor

Comments

@ivan-mogilko
Copy link
Contributor

ivan-mogilko commented Mar 8, 2024

Problem

Because in AGS color index <-> RGB mapping is done based on 16-bit RGB values, both Editor and Engine fixup any assigned RGB value by clamping its components to R5G6B5 format (i think). (On a side note, there's a task to remove this clamping in ags4, see #1980)

However, it seems that Editor's mapping is different from the Engine's.
Sometimes the RGB value typed into a property field is clamped to one result, but using Game.GetColorFromRGB in script produces a different result.

For example:
Input value: 167, 181, 147
Editor clamps to: 160, 180, 144
Engine clamps to: 165, 182, 148

UPDATE: user reports there's another inconsistency, when using Colours Pane for making color numbers and then trying to insert them into the color number properties. Following is user's explanation:

I plugged in 73, 106, 69 into the colour selector in the colour panel
it spat out a decimal number
I plugged in that number into the speechview colour
it reclamped it to 72, 104, 64
but if I go to the Colour Panel and tap the FIND COLOUR next to the generated number of 19272
it shows 73, 106, 69

AGS Version

Any 3.* version, I think.

Expected behavior

I believe that the Editor should comply to the engine's formula when clamping colors.

@ivan-mogilko ivan-mogilko added type: bug unexpected/erroneous behavior in the existing functionality context: graphics what: editor related to the game editor labels Mar 8, 2024
@ivan-mogilko ivan-mogilko added context: bw-compat supporting deprecated runtime functionality, importing and converting game data ags3 related to ags3 (version with full backward compatibility) labels Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ags3 related to ags3 (version with full backward compatibility) context: bw-compat supporting deprecated runtime functionality, importing and converting game data context: graphics type: bug unexpected/erroneous behavior in the existing functionality what: editor related to the game editor
Projects
None yet
Development

No branches or pull requests

1 participant