Skip to content

jme3-nifty should account for gamma correction #1764

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

Merged
merged 4 commits into from
Feb 6, 2022

Conversation

stephengold
Copy link
Member

This solves an issue with jme3-nifty not taking gamma correction into account. Nifty UIs specify colors by their red, green, and blue components. In order for jme3-nifty to display these colors property, it needs to know whether gamma correction is enabled or not.

If gamma correction is enabled, the application should specify ColorSpace.sRGB, in which case ColorRGBA.setAsSrgb() will be used to convert Nifty colors to JME colors.

If gamma correction is not enabled, the application should use the old constructor or specify ColorsSpace.Linear, in which case ColorRGBA.set() will be used to convert Nifty color to JME colors.

@stephengold stephengold added the defect Something that is supposed to work, but doesn't. Less severe than a "bug" label Feb 1, 2022
@stephengold stephengold added this to the Future Release milestone Feb 1, 2022
@stephengold
Copy link
Member Author

stephengold commented Feb 2, 2022

Here's a screenshot of how TestIssue99 looked with gamma correction enabled, prior to this change:
linear-gamma-crop

...and here's how it was intended to look (how it looked with gamma correction disabled):
linear-noGamma2-crop

Note how gamma correction made the left side of the scrollpanel too bright.

@stephengold stephengold requested a review from tonihele February 3, 2022 19:59
Copy link
Contributor

@tonihele tonihele left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@stephengold stephengold merged commit 1a09eff into master Feb 6, 2022
@stephengold stephengold deleted the sgold/nifty-gamma-correction branch February 6, 2022 17:31
@Ali-RS Ali-RS modified the milestones: Future Release, v3.6.0 Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Something that is supposed to work, but doesn't. Less severe than a "bug"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants