Accessibility First DevRel. I focus on ensuring content created, events held and company assets are as accessible as possible, for as many people as possible.
If you get a 220 luminosity result you are trying to add 100 to it and capping at 255. I think all you have done is swap your greater thans and less thans by mistake!
Also with the way you have done it you could actually just do
Less than 127, add 100. Greater than 127, remove 100. You will never go out of bounds so you donβt need the additional checks. (126+100 or 127 - 100, it will always be within 0 to 255.)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think you made another minor mistake ππ€£
If you get a 220 luminosity result you are trying to add 100 to it and capping at 255. I think all you have done is swap your greater thans and less thans by mistake!
Also with the way you have done it you could actually just do
Less than 127, add 100. Greater than 127, remove 100. You will never go out of bounds so you donβt need the additional checks. (126+100 or 127 - 100, it will always be within 0 to 255.)