public int getColor(float radio,int mStartColor,int mEndColor) { Log.e("lsw","----- 分"+radio); int redStart = Color.red(mStartColor); int blueStart = Color.blue(mStartColor); int greenStart = Color.green(mStartColor); int redEnd = Color.red(mEndColor); int blueEnd = Color.blue(mEndColor); int greenEnd = Color.green(mEndColor); int red = (int) (redStart + ((redEnd - redStart) * radio + 0.5)); int greed = (int) (greenStart + ((greenEnd - greenStart) * radio + 0.5)); int blue = (int) (blueStart + ((blueEnd - blueStart) * radio + 0.5)); Log.e("lsw","----- 分"+ Color.argb(255,red, greed, blue)); return Color.argb(255,red, greed, blue); }
获取图片 渐变色
最新推荐文章于 2023-12-15 19:41:18 发布