Round(Brightness Value / 255 x 100)
For example: Say you get the value 127 this will then represent 50%
Round(127 / 255 * 100) = 50
Thank you NJDude for your response. I need a little further clarification. It seems that we are dealing with two brightness scales. The first being (0 to 255), the second (0 to 100).
We also have:
1: WriteSetting, to change the system setting
and
2: Phone.SetScreenBrightness, to change current brightness
Question: In the example - Round(127 / 255 * 100) = 50, we have the start value of 127 and the rounded value of 50. Both of these values relate to 50% brightness. If brightness is set within a value of (0 to 50), as a product of the rounding formula, where does the 127 come into the mix? Are both of these values used to set the brightness? Say, one to change the system setting, and the other to change current brightness.
I’m confused as to why we are rounding the first value to produce the second. If only one value is required, why not just use the scale (0 to 100)? I expect there is a valid reason for the rounding process. I just don’t know what that reason is. Can you explain this to me?
Regards