-
-
Notifications
You must be signed in to change notification settings - Fork 417
Re-range text opacity from [-128, 127] to [0, 255] #8330
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
Re-range text opacity from [-128, 127] to [0, 255] #8330
Conversation
Yes, it should be fully transparent at 25
|
Whoops, missed. Why specifically 4 to 26 and not 1 to 26? |
idk mate ask mojang, baffles me too
|
I swear I read it, super sorry lol. |


Problem
Text display opacity is very confusing and hard to work with, since it goes from fully transparent at 4, to half opaque at 127, to half opaque at -128, to fully opaque at -1. Re-ranging this to be a simple 4-255 scale would be much easier for users to use and understand (it's what snbt does, too!)
Really, this should have been done from the start.
Solution
Returns opacities from 0 to 255 now, adding 256 to any value < 0. This is a breaking change.
Setting opacity still supports -127 to -1, but adding/subtracting will limit the values to 0 to 255.
The alternative is to allow as much wrapping as desired (eg, subtracting 300 will loop all the way around and be equal to subtracting 44, and users can set the opacity to any value they want and it will be modulo-ed to 0-255). This is versatile but very counter-intuitive for new users. Setting opacity to 300 and getting a result of 44 doesn't make much sense. It's still a minor issue in the current impl, where you can set to -10 and get 246, but that's for backwards compat and can be forgiven imo.
Testing Completed
ExprTextDisplayOpacity.sk
Supporting Information
Created after 2 users reported significant issues trying to deal with text opacity in skunity help channels.
Completes: none
Related: none
AI assistance: none