android - Calculate opacity and saturation from color given in signed integer format -


in android app have color pick activity using lars werkman colorpicker view. i'd start activity setting color picker , opacity saturation bars values of selected color. color picker easy opacity , saturation bars need calculation first.

how can calculate these 2 values given signed-integer form of color?

float[] hsv = new float[3]; color.colortohsv(currentcolor, hsv); //hsv hue, saturation, value float saturation = hsv[1]; float value = hsv[2]; int opacity = color.alpha(currentcolor); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -