slider - Inverting alpha value java -
i writing game slider controls alpha value of color. seems working fine except want invert alpha value. example if value 0 value become 255, , if value 255 become 0. unfortunately google searches turned no easy way or built in methods doing this. appreciated thanks.
do simple math :
int alphavalue = 255 - slidervalue
for example:
when
slidervalue
= 0,alphavalue
= 255 - 0 = 255when
slidervalue
= 255,alphavalue
= 255 - 255 = 0
Comments
Post a Comment