Color picker with usage in android

后端 未结 2 862
伪装坚强ぢ
伪装坚强ぢ 2020-12-09 07:34

Can someone provide me some code of a color picker and it\'s usage in android?

I found some example here Android Color Picker, but I don\'t know how to use it :(

2条回答
  •  萌比男神i
    2020-12-09 07:58

    I found this one: https://www.buzzingandroid.com/2012/11/hsv-color-picker-dialog

    Since FloatMath been depreciated I made the following changes:

    import java.lang.Math;
     //import android.util.FloatMath;
    
    selectedPoint.x = rect.left + (int) ((float)-Math.cos( hueInPiInterval ) * colorHsv[1] * innerCircleRadius + fullCircleRadius);
    selectedPoint.y = rect.top + (int) ((float)-Math.sin( hueInPiInterval ) * colorHsv[1] * innerCircleRadius + fullCircleRadius);
    //selectedPoint.x = rect.left + (int) (-FloatMath.cos( hueInPiInterval ) * colorHsv[1] * innerCircleRadius + fullCircleRadius);
    //selectedPoint.y = rect.top + (int) (-FloatMath.sin( hueInPiInterval ) * colorHsv[1] * innerCircleRadius + fullCircleRadius);
    

    ` It is the best color picker I've ever seen! Very easy to use and well described. Hope it may work for you as ell.

提交回复
热议问题