android rgb颜色设置方法及常用颜色的RGB值
16lz
2021-01-26
1.android设置rgb颜色方法
每一个rgb颜色都对应一个int数值,所以我们可以这么设置:
private static final int default_background_color = Color.rgb(0, 0, 0);
如何调用这个颜色值呢?
比如我们要设置背景颜色,则可以使用
imageview.setBackgroundColor(Color.parseColor(“#f34649”));
imageview.setBackgroundColor(Color.rgb(213, 0, 0));
imageview.setBackgroundColor(default_background_color );
2. 常用颜色的RGB值
白色:rgb(255,255,255)
黑色:rgb(0,0,0)
红色:rgb(255,0,0)
绿色:rgb(0,255,0)
蓝色:rgb(0,0,255)
青色:rgb(0,255,255)
紫色:rgb(255,0,255)
调整相关数字,便可以得到深浅不一的各种颜色。
可以得到深浅不一的各种颜色。
更多相关文章
- Android(安卓)PullToRefresh(下拉刷新)的使用详解
- 代码设置EditText只输入数字、字母
- android studio代理设置
- Mac 中eclipse 遇到的问题及简单设置
- Android(安卓)Java中调用js代码,js中调用Java代码
- Android(安卓)自定义dialog
- Android中两种设置全屏的方法!!!
- android 通过设置intent-filter 启动程序
- Android(安卓)访问权限清单