Android color 平滑过渡计算
来源:互联网 发布:视频后期编辑软件 编辑:程序博客网 时间:2024/05/18 18:47
/** * 根据fraction值来计算当前的颜色。 */private int getCurrentColor(float fraction, int startColor, int endColor) { int redCurrent; int blueCurrent; int greenCurrent; int alphaCurrent; int redStart = Color.red(startColor); int blueStart = Color.blue(startColor); int greenStart = Color.green(startColor); int alphaStart = Color.alpha(startColor); int redEnd = Color.red(endColor); int blueEnd = Color.blue(endColor); int greenEnd = Color.green(endColor); int alphaEnd = Color.alpha(endColor); int redDifference = redEnd - redStart; int blueDifference = blueEnd - blueStart; int greenDifference = greenEnd - greenStart; int alphaDifference = alphaEnd - alphaStart; redCurrent = (int) (redStart + fraction * redDifference); blueCurrent = (int) (blueStart + fraction * blueDifference); greenCurrent = (int) (greenStart + fraction * greenDifference); alphaCurrent = (int) (alphaStart + fraction * alphaDifference); return Color.argb(alphaCurrent, redCurrent, greenCurrent, blueCurrent);}
0 0
- Android color 平滑过渡计算
- Android搜索栏平滑过渡
- android平滑过渡的动画效果
- Android 颜色过渡计算
- Android使用TextSwitcher和ImageSwitcher实现平滑过渡
- Android buttom textview 颜色平滑过渡的动画效果
- android 开发技巧(5)--使 用 TextSwitcher 实现平滑过渡
- Android 如何实现一个平滑过渡的ViewPager广告条
- Android 如何实现一个平滑过渡的ViewPager广告条
- html5 学习--平滑过渡
- Color过渡动画
- smoothstep(),平滑阶梯函数,平滑过渡函数
- Unity3d摄像机的平滑过渡
- UIImageView 平滑过渡图片切换
- 【android】平滑Activity过渡动画效果,类库已分离,使用只需1行代码
- Android实现真正的ViewPager【平滑过渡】+【循环滚动】!!!顺带还有【末页跳转】。
- Android Color 颜色过度计算实现方法
- Android之Color 颜色过度计算
- You don’t have permission to save the file “project.xcworkspace” in the folder
- 51单片机--矩阵键盘
- 项目在android studio中的问题
- 简单的使用SwipeRefreshLayout
- python第15天:异常
- Android color 平滑过渡计算
- Linux下如何查看哪些进程占用的CPU内存资源最多
- java http xml java通过http来访问一个xml文件的读取过程
- 导航栏隐藏的平滑切换
- 服务器选择Windows还是Linux
- 蓝桥杯
- MFC界面库BCGControlBar v25.2新版亮点:Dialogs和Grid控件等
- 二叉树的重要性质
- 面试常考--二叉树算法