question: protected void onUpdateColorSelection ( int x , int y ) { x = ( int ) Math . max ( mGradientRect . left , Math . min ( x , mGradientRect . right ) ) ; y = ( int ) Math . max ( mGradientRect . top , Math . min ( y , mGradientRect . bottom ) ) ; if ( mIsBrightnessGradient ) { float b = pointToValueBrightness ( x ) ; mHSV [ 2 ] = b ; mSelectedColor = Color . HSVToColor ( mHSV ) ; } else { float hue = pointToHue ( x ) ; float sat = pointToSaturation ( y ) ; mHSV [ 0 ] = hue ; mHSV [ 1 ] = sat ; mHSV [ 2 ] = 1f ; mSelectedColor = Color . HSVToColor ( mHSV ) ; } dispatchColorChanged ( mSelectedColor ) ; String color = Integer . toHexString ( mSelectedColor ) ; }
target:  Update color based on touch events