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)

调整相关数字,便可以得到深浅不一的各种颜色。
可以得到深浅不一的各种颜色。

更多相关文章

  1. Android(安卓)PullToRefresh(下拉刷新)的使用详解
  2. 代码设置EditText只输入数字、字母
  3. android studio代理设置
  4. Mac 中eclipse 遇到的问题及简单设置
  5. Android(安卓)Java中调用js代码,js中调用Java代码
  6. Android(安卓)自定义dialog
  7. Android中两种设置全屏的方法!!!
  8. android 通过设置intent-filter 启动程序
  9. Android(安卓)访问权限清单

随机推荐

  1. Android(安卓)activity的生命周期
  2. android启动另一应用
  3. Android(安卓)修改WiFi热点的默认SSID和
  4. android 启动流程
  5. 自定义View
  6. service的隐式启动和显示启动
  7. Android(安卓)网络状态实时监测
  8. android Beam
  9. Android系统信息(内存、cpu、sd卡、电量、
  10. Android(安卓)调用系统相机拍照保存以及