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

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -